http2_server
Generated by tinox doc
tinox.core.http2_server, split out of the bundled stdlib as a standalone tinox-central package.
| Module | Version | Group |
|---|---|---|
hpack (no local docs) | 1.2.2 | tinox.core |
http_server (no local docs) | 1.2.3 | tinox.core |
Hello server
import tinox.core.http2_server
class Main
{
fnc main() -> Int32
{
const server: Http2Server = Http2Server::new(8443)
server.get("/hello", ctx => {
ctx.response.text("Hello over HTTP/2!")
})
server.listen()
return 0
}
}
class Http2Conn
* State for one HTTP/2 client connection. * Holds all active streams and both encoder/decoder HPACK tables.
Fields
handle | Int64 | |
streams | Map<String, Http2Stream> | |
recvDynTable | HpackDynTable | |
sendDynTable | HpackDynTable | |
peerMaxFrameSize | Int64 | |
peerInitWindowSize | Int64 | |
lastStreamId | Int64 |
Methods
class Http2Error
Methods
class Http2Flags
Methods
class Http2Frame
* An HTTP/2 frame with its 9-byte fixed header fields and payload. * The payload is a list of raw byte values (Int64, each 0–255).
Fields
length | Int64 | |
type | Int64 | |
flags | Int64 | |
streamId | Int64 | |
payload | List<Int64> |
Methods
class Http2FrameType
Methods
fn tinoxBytesToString(bytes: List<Int64>) → String
fn tinoxSecurityGuard(ctx: HttpContext, routeExists: Int64) → Int64
fn tinoxHttpRequestBodyFromBytes(bytes: List<Int64>) → String
fn tinoxHttpClearBodyBridge() → Nothing
fn tinoxHttpBodyLength(body: String) → Int64
fn tinoxHttpBodySlice(body: String, start: Int64, end: Int64) → List<Int64>
class Http2Server
* HTTP/2 server with a fluent route-registration API identical to HttpServer. * * Handles the full HTTP/2 connection lifecycle per RFC 7540: * connection preface validation, SETTINGS exchange, binary frame I/O, * HPACK decoding for requests and encoding for responses, * multi-stream multiplexing, and graceful GOAWAY shutdown.
Fields
port | Int64 | |
routes | List<Route> | |
middleware | List<fnc(HttpContext) -> Bool> | |
socketHandle | Int64 | |
running | Bool |
Methods
@Errorclass Http2ServerError
* The HTTP/2 server could not start.
Fields
message | String |
class Http2Settings
Methods
class Http2Stream
* Per-stream state for an HTTP/2 connection. * * Accumulates the HPACK-encoded header block across one or more * HEADERS/CONTINUATION frames, and body bytes from DATA frames.
Fields
id | Int64 | |
state | String | "open" | "half_closed_remote" | "closed" |
headerBlock | List<Int64> | |
body | List<Int64> | |
endStream | Bool | |
expectingContinuation | Bool |