Expand description
Opportunistic HTTP/3 server support for mechanics-family services.
This crate provides two additive building blocks for binaries
that already own their HTTP/1.1 and HTTP/2 TCP+TLS listener:
an opt-in HTTP/3 QUIC listener and a tower middleware layer
that emits Alt-Svc on the existing TCP+TLS path.
Activation is controlled by Http3ServerConfig::bind_h3.
When it is None, Http3Server::start returns an inert
handle immediately: no UDP socket is opened and no
quinn::Endpoint is constructed. When it is Some, this
crate binds that UDP address and routes HTTP/3 requests into
the supplied tower service.
TLS material is supplied by the caller as
rustls::pki_types::CertificateDer and
rustls::pki_types::PrivateKeyDer. The QUIC-side TLS
configuration uses the aws-lc-rs rustls provider and ALPN
h3 only. This server crate deliberately has no
webpki-roots dependency and no ring dependency.
HTTP/1.1, HTTP/2 over TCP+TLS, and cleartext HTTP/1.1 remain the consumer binary’s responsibility. This crate does not construct or alter those listeners.
Modules§
- axum_
compat - Compatibility helpers for routing HTTP/3 requests into axum.
Structs§
- AltSvc
Layer - Tower layer that inserts an HTTP/3
Alt-Svcresponse header. - AltSvc
Service - Service produced by
AltSvcLayer. - H3Request
Body - Streaming request body received from an HTTP/3 client.
- Http3
Handle - Handle returned by
Http3Server::start. - Http3
Server - Optional HTTP/3 listener that runs alongside an existing TCP+TLS server.
- Http3
Server Config - Configuration for the HTTP/3 listener.
Enums§
- Error
- Errors returned by
mechanics-http-server. - H3Request
Body Error - Error returned while receiving an HTTP/3 request body.
Functions§
- alt_
svc_ layer - Build an
AltSvcLayerforh3=":<port>"; ma=<max-age>. - default_
zero_ rtt_ methods - Default methods considered safe for replayable 0-RTT requests.
- is_
zero_ rtt_ safe - Return whether
methodis allowed by the configured 0-RTT policy.
Type Aliases§
- Result
- Crate-local result alias.