Skip to main content

Module alt_svc

Module alt_svc 

Available on crate features http and std only.
Expand description

Learn HTTP alternative services from origin responses.

RFC 7838 allows an origin to advertise alternative protocols, hosts and ports; the mechanism is independent of HTTP/3. AltSvcCache retains all advertised protocols, and connector selection applies client capabilities. Response headers are learned here; HttpServiceConnector also activates connection-level learning of HTTP/2 ALTSVC frames, including idle connections. DNS HTTPS/SVCB discovery is a separate mechanism and must not be recorded as an Alt-Svc advertisement.

Each request supplies its logical origin; connection metadata supplies the actual endpoint, authenticated identity and policy scope. The middleware records response hints and sets the typed Alt-Used request header. Connection selection, authentication and retry policy remain the transport’s responsibility; a request is dispatched exactly once.

Structs§

AltSvc
Service applying an AltSvcLayer to an established connection.
AltSvcBody
Response body preserving the underlying frames and errors while recording complete responses and remote failures of a discovered alternative. Dropping an unread body is not evidence of success or endpoint failure. The wrapper does not allocate.
AltSvcCache
Bounded Alt-Svc advertisements, independent of connector protocol capabilities.
AltSvcLayer
Observe alternative services on an HTTP request service.