Expand description
HTTP/1.1 and HTTP/2 multiplexing layer.
This module unifies HTTP/1.1 and HTTP/2 behind a single Mux session
state machine that integrates with sozu’s mio event loop. The key types:
Mux: The top-level session state, generic over socket (TcpStreamorFrontRustls) and listener. ImplementsSessionState.Connection: Enum dispatching toConnectionH1orConnectionH2for protocol-specific readable/writable logic.Stream: Per-request state with front/back kawa buffers, metrics, and lifecycle tracking. Shared between H1 and H2 paths.Context: Per-session context (cluster, backends, routing, timeouts).
The H2 implementation handles RFC 9113 framing, HPACK (RFC 7541), flow control, flood detection (CVE-2023-44487, CVE-2019-9512/9514/9515/9518, CVE-2024-27316), and graceful shutdown (double-GOAWAY per RFC 9113 §6.8).
Re-exports§
pub use crate::protocol::mux::answers::terminate_default_answer;pub use crate::protocol::mux::connection::Connection;pub use crate::protocol::mux::debug::DebugEvent;pub use crate::protocol::mux::debug::DebugHistory;pub use crate::protocol::mux::parser::H2Error;pub use crate::protocol::mux::router::Router;pub use crate::protocol::mux::stream::Stream;pub use crate::protocol::mux::stream::StreamParts;pub use crate::protocol::mux::stream::StreamState;
Modules§
- answers
- Default-answer helpers shared by the H1 and H2 mux paths.
- auth
- HTTP Basic authentication helpers shared by the H1 and H2 mux paths.
- connection
- Protocol-agnostic frontend/backend connection wrapper.
- debug
- Debug history ring buffer and event enum.
- parser
- H2 frame parser (nom-based).
- router
- Backend routing and connection reuse for the mux layer.
- stream
- Per-request stream state shared by the H1 and H2 mux paths.
Structs§
- Connection
H1 - HTTP/1.1 connection handler within the mux layer.
- Connection
H2 - Context
- H2Byte
Accounting - Byte accounting for connection overhead attribution.
- H2Connection
Config - Configurable H2 connection tuning parameters.
- H2Drain
State - Connection draining state for graceful shutdown.
- H2Flood
Config - Configurable thresholds for H2 flood detection.
- H2Flow
Control - Connection-level flow control state (RFC 9113 §6.9).
- Mux