nhttp3

Production-grade QUIC + HTTP/3 in Rust. Built from scratch. Every layer visible, every byte accounted for.

GET STARTED API Docs GitHub
207 tests
7 RFCs
8 crates
0 unsafe
cargo add nhttp3

// modules

8 crates, one stack

nhttp3-quic

QUIC Transport

Packets, frames, TLS 1.3 via rustls, streams, flow control, loss detection, NewReno + CUBIC + BBR, QLOG, endpoint I/O loop.

nhttp3-h3

HTTP/3 Protocol

Frame codec, pseudo-header validation, HTTP crate types, error codes per RFC 9114.

nhttp3-qpack

QPACK Compression

Static table (99 entries), dynamic table, encoder/decoder. 50% compression on realistic headers.

nhttp3-python

Python Bindings

PyO3 + custom async bridge. No pyo3-asyncio. Tokio runtime on background thread.

nhttp3-wasm

WASM Target

wasm-bindgen. Browser via WebTransport, non-browser via raw UDP.

nhttp3-ffi

C FFI Layer

Opaque handles, callback-based async, error codes. Runtime managed internally.


// performance

Benchmarks: HTTP/3 vs HTTP/2

HTTP/3 (nhttp3) HTTP/2
TLS Handshake
HTTP/3 QUIC+TLS
1-RTT
154 µs
HTTP/2 TCP+TLS
2-RTT
166 µs
In-process TLS. Over a real network, HTTP/3 saves a full RTT.
Codec Throughput
STREAM frame 1200B
18.7 GB/s
64 ns
STREAM parse 1200B
16.4 GB/s
73 ns
QPACK encode 6h
680 ns
VarInt encode
20 ns
Header Compression
Raw (10 headers)
334 bytes
334 B
QPACK compressed
50% smaller
167 B

// compliance

7 RFCs implemented

RFCTitleStatus
9000QUIC TransportACTIVE
9001Using TLS to Secure QUICACTIVE
9002Loss Detection + Congestion ControlACTIVE
9114HTTP/3ACTIVE
9204QPACK Header CompressionACTIVE
9218Extensible PrioritiesACTIVE
9221QUIC DatagramsACTIVE

// hardening

Security audited

Reviewed against 200+ issues from aioquic + quiche. Zero unsafe blocks.

ACK RANGE LIMITCapped at 256 — DoS prevention
FRAME SIZE LIMIT16MB max payload per frame
PACKET VALIDATIONInitial ≥ 1200 bytes enforced
CRYPTO BUFFER128KB cap prevents OOM
STATELESS RESETConstant-time token validation
CID ENTROPYMixed entropy, collision-resistant
IDLE TIMEOUTmin(local, remote) per RFC
MUTEX SAFETYGraceful poisoned-lock handling

// integrations

Drop-in for any framework

Python / FastAPI

Native ASGI Server

nhttp3.serve(app, port=4433)
No uvicorn. No proxy. Rust QUIC server calls your ASGI app directly via PyO3. Proven with FastAPI.

Node.js

Native Addon

serve(4433, handler)
napi-rs addon with embedded quinn. JS callback for each request. QPACK compression included.

Rust

Server + Client

HTTP/3 server with demo + proxy modes. Client with verbose timing. Native QUIC inference server for token streaming.

Any HTTP Server

Reverse Proxy

--proxy http://localhost:8000
Put HTTP/3 in front of Express, Django, Rails, anything. Helps remote clients (saves 2.5 RTTs).


// clients

Connecting to nhttp3

ClientHowDocs
nhttp3-client Built-in Rust client with timing and verbose output cargo run -p nhttp3-server --bin nhttp3-client -- URL
curl curl 7.88+ with --http3 flag. Parallel with --parallel curl guide
Browser Auto-negotiates via Alt-Svc. Standard fetch() works. WebTransport for streams. browser guide · live demo
Python conn = await ep.connect("host", 443) python guide
All clients connect to any nhttp3 server (Python, Node.js, or Rust). The protocol is standard HTTP/3 — any HTTP/3 client works.

// structure

Architecture

                    +-------------------+
                    |    Application    |
                    +--------+----------+
                             |
                    +--------v----------+
                    |     nhttp3-h3     |  HTTP/3 frames, headers
                    +--------+----------+
                             |
              +--------------+--------------+
              |              |              |
     +--------v--------+    |    +---------v--------+
     |   nhttp3-qpack  |    |    |    Extensions    |
     |   QPACK codec   |    |    |  Datagram / Prio |
     +-----------------+    |    +------------------+
                             |
                    +--------v----------+
                    |    nhttp3-quic    |  Endpoint, TLS, streams
                    |                   |  loss, congestion, QLOG
                    +--------+----------+
                             |
                    +--------v----------+
                    |    nhttp3-core    |  VarInt, CID, errors
                    +-------------------+

// examples

Code examples

ExampleWhatLinks
Python nhttp3.serve(app) — native ASGI, no uvicorn (tested, working) guide · example · source
Node.js serve(port, handler) — native addon via napi-rs (tested, working) guide · source
Rust Server HTTP/3 server + client + benchmarks (5 e2e tests, 0.12s) source
Browser Fetch API, WebTransport, SSE streaming client live demo · source
curl curl --http3 reference: streaming, parallel, timing guide · reference
Reverse Proxy --proxy http://localhost:8000 (for any existing HTTP server) guide