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.8 | tinox.core |
http_server (no local docs) | 1.2.9 | 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 | |
dead | Bool | Set once a connection error (GOAWAY) was sent: the frame loop stops. |
continuationStream | Int64 | Stream id whose header block is still open (awaiting CONTINUATION), else 0. |
sendWindow | Int64 | Connection-level send window as announced by WINDOW_UPDATE frames. |
openStreams | Int64 | |
sendQueue | List<Int64> | Streams whose response body is still waiting for flow-control credit, in arrival order. |
closedCount | 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 | |
headers | List<HpackHeader> | Decoded request header fields (decoded when END_HEADERS arrives, in wire order). |
headersDone | Bool | True once the initial header block is complete; a later HEADERS is a trailer block. |
trailerBlock | Bool | |
sendWindow | Int64 | |
refused | Bool | Over the concurrent-stream limit: decoded for HPACK state, then answered with RST_STREAM. |
outBody | String | Response body still to be sent (flow-controlled), with the bytes already written. |
outBytes | List<Int64> | Byte copy of a body that could not be sent at once (the length-aware bridge is only valid right after the handler ran). |
bodyLength | Int64 | |
sendOffset | Int64 |