HTTP/3 and QUIC
Serving HTTP/3#
import serve, serve/reactor
serveH3Reactor(8443, tlsContext, handler)QUIC needs its transport glue shim built and available on the loader path — the repo ships quic/build.sh for this.
Discovery from HTTP/1.1 and HTTP/2#
Browsers don't speak QUIC first; they discover it from a TCP response. Every TCP response from serveAllReactor carries Alt-Svc: h3=":<port>", which tells the browser HTTP/3 is available on the same port over UDP and lets it upgrade the next request on its own.
Request bodies and POST#
HTTP/3 server handlers receive (meth, path, headers, body) — POST bodies over QUIC are supported directly, not bolted on. See h3_post.nim and reactor_h3.nim.
WebTransport#
WebTransport runs over HTTP/3's extended CONNECT — see wt_echo.nim. It includes unreliable datagrams over QUIC per RFC 9221 (dgram_echo.nim), and bounded-resource overflow is counted rather than silently dropped — see wt_stream_echo.nim.
Conformance#
HTTP/3 support is checked against third-party interop — aioquic — rather than only against serve's own client, which catches spec deviations a self-test would miss.
Related#
- The reactor — how one port serves TCP and UDP together
- HTTP/2
- WebSocket
