pub struct HttpListenerConfig {Show 31 fields
pub address: SocketAddress,
pub public_address: Option<SocketAddress>,
pub expect_proxy: bool,
pub sticky_name: String,
pub front_timeout: u32,
pub back_timeout: u32,
pub connect_timeout: u32,
pub request_timeout: u32,
pub active: bool,
pub http_answers: Option<CustomHttpAnswers>,
pub h2_max_rst_stream_per_window: Option<u32>,
pub h2_max_ping_per_window: Option<u32>,
pub h2_max_settings_per_window: Option<u32>,
pub h2_max_empty_data_per_window: Option<u32>,
pub h2_max_continuation_frames: Option<u32>,
pub h2_max_glitch_count: Option<u32>,
pub h2_initial_connection_window: Option<u32>,
pub h2_max_concurrent_streams: Option<u32>,
pub h2_stream_shrink_ratio: Option<u32>,
pub h2_max_rst_stream_lifetime: Option<u64>,
pub h2_max_rst_stream_abusive_lifetime: Option<u64>,
pub h2_max_rst_stream_emitted_lifetime: Option<u64>,
pub h2_max_header_list_size: Option<u32>,
pub h2_stream_idle_timeout_seconds: Option<u32>,
pub h2_max_header_table_size: Option<u32>,
pub h2_graceful_shutdown_deadline_seconds: Option<u32>,
pub h2_max_window_update_stream0_per_window: Option<u32>,
pub sozu_id_header: Option<String>,
pub answers: BTreeMap<String, String>,
pub elide_x_real_ip: Option<bool>,
pub send_x_real_ip: Option<bool>,
}Expand description
details of an HTTP listener
Fields§
§address: SocketAddress§public_address: Option<SocketAddress>§expect_proxy: bool§sticky_name: String§front_timeout: u32client inactive time, in seconds
back_timeout: u32backend server inactive time, in seconds
connect_timeout: u32time to connect to the backend, in seconds
request_timeout: u32max time to send a complete request, in seconds
active: boolwether the listener is actively listening on its socket
http_answers: Option<CustomHttpAnswers>DEPRECATED: per-status answer message. Prefer the answers map at
field 31. Kept on the wire so legacy state files round-trip cleanly;
workers populate both fields and treat them as equivalent on read.
h2_max_rst_stream_per_window: Option<u32>H2 flood detection thresholds (CVE mitigations). All are optional; when absent, built-in defaults are used. Maximum RST_STREAM frames per second window (CVE-2023-44487, CVE-2019-9514)
h2_max_ping_per_window: Option<u32>Maximum PING frames per second window (CVE-2019-9512)
h2_max_settings_per_window: Option<u32>Maximum SETTINGS frames per second window (CVE-2019-9515)
h2_max_empty_data_per_window: Option<u32>Maximum empty DATA frames per second window (CVE-2019-9518)
h2_max_continuation_frames: Option<u32>Maximum CONTINUATION frames per header block (CVE-2024-27316)
h2_max_glitch_count: Option<u32>Maximum accumulated protocol anomalies before ENHANCE_YOUR_CALM
h2_initial_connection_window: Option<u32>H2 connection tuning parameters. Connection-level receive window size in bytes (RFC 9113 §6.9.2). Default: 1048576 (1MB). The RFC default of 65535 is too small for proxying.
h2_max_concurrent_streams: Option<u32>Maximum concurrent H2 streams the proxy accepts (SETTINGS_MAX_CONCURRENT_STREAMS). Default: 100.
h2_stream_shrink_ratio: Option<u32>Shrink threshold ratio for recycled stream slots. Vec is shrunk when total_slots > active_streams * ratio. Default: 2.
h2_max_rst_stream_lifetime: Option<u64>Absolute lifetime cap on RST_STREAM frames received on a single H2 connection (CVE-2023-44487). Default: 10000.
h2_max_rst_stream_abusive_lifetime: Option<u64>Lifetime cap on “abusive” (pre-response-start) RST_STREAM frames received on a single H2 connection — the Rapid Reset signature. Default: 50.
h2_max_rst_stream_emitted_lifetime: Option<u64>Absolute lifetime cap on RST_STREAM frames emitted by the server
on a single H2 connection (CVE-2025-8671 “MadeYouReset”). Covers the
emission-direction-flipped sibling of Rapid Reset, where an attacker
sends legitimate-looking frames (Content-Length mismatch, header parse
error, rejected priority, zero-increment WINDOW_UPDATE on an open
stream) that coerce the server into emitting RST_STREAM. Graceful
NoError cancels are exempt. Default: 500.
h2_max_header_list_size: Option<u32>Maximum accumulated HPACK-decoded header list size per request (SETTINGS_MAX_HEADER_LIST_SIZE, RFC 9113 §6.5.2). Default: 65536.
h2_stream_idle_timeout_seconds: Option<u32>Per-stream idle timeout, in seconds. An open H2 stream that receives
no meaningful application data (non-empty DATA or HEADERS frames) for
this duration is cancelled (RST_STREAM / CANCEL). Active uploads that
trickle DATA frames reset the timer on each non-empty frame. Defends
against slow-multiplex Slowloris where a client keeps connection-level
activity high (any frame resets the connection idle timer) while pinning
up to h2_max_concurrent_streams streams. Default: 30.
h2_max_header_table_size: Option<u32>Maximum HPACK dynamic table size (SETTINGS_HEADER_TABLE_SIZE) accepted from the peer. Caps the peer-advertised value to prevent unbounded HPACK encoder memory growth. Default: 65536.
h2_graceful_shutdown_deadline_seconds: Option<u32>Maximum wall-clock seconds to wait for in-flight H2 streams after GOAWAY(NO_ERROR) before forcibly closing the connection. Default: 5. Set to 0 to require streams to finish (no forced close).
h2_max_window_update_stream0_per_window: Option<u32>Maximum connection-level (stream 0) WINDOW_UPDATE frames per second window. Caps non-zero stream-0 WINDOW_UPDATE floods that would otherwise stay under the generic glitch counter (zero-increment stream-0 updates already trigger GOAWAY per RFC 9113 §6.9). Default: 100.
sozu_id_header: Option<String>Name of the correlation header Sozu injects into every request and response to carry the per-request ULID. Default: “Sozu-Id”. Operators who want to rebrand can set e.g. “X-Edge-Id” or “X-Request-Trace”.
answers: BTreeMap<String, String>Per-status HTTP answer template bodies, keyed by HTTP status code
(e.g. “404”, “503”). Replaces the per-field shape of CustomHttpAnswers
(field 12). The new field is populated alongside http_answers so
legacy state files round-trip; new code should read this map.
elide_x_real_ip: Option<bool>When true, any client-supplied X-Real-IP header is stripped from
requests before forwarding (anti-spoofing). Independently combinable
with send_x_real_ip. Default: false.
send_x_real_ip: Option<bool>When true, a proxy-generated X-Real-IP header carrying the connection
peer IP (post-PROXY-v2 unwrap, i.e. the original client IP) is appended
to every forwarded request. Independently combinable with
elide_x_real_ip. Default: false.
Implementations§
Source§impl HttpListenerConfig
impl HttpListenerConfig
Sourcepub fn h2_max_rst_stream_per_window(&self) -> u32
pub fn h2_max_rst_stream_per_window(&self) -> u32
Returns the value of h2_max_rst_stream_per_window, or the default value if h2_max_rst_stream_per_window is unset.
Sourcepub fn h2_max_ping_per_window(&self) -> u32
pub fn h2_max_ping_per_window(&self) -> u32
Returns the value of h2_max_ping_per_window, or the default value if h2_max_ping_per_window is unset.
Sourcepub fn h2_max_settings_per_window(&self) -> u32
pub fn h2_max_settings_per_window(&self) -> u32
Returns the value of h2_max_settings_per_window, or the default value if h2_max_settings_per_window is unset.
Sourcepub fn h2_max_empty_data_per_window(&self) -> u32
pub fn h2_max_empty_data_per_window(&self) -> u32
Returns the value of h2_max_empty_data_per_window, or the default value if h2_max_empty_data_per_window is unset.
Sourcepub fn h2_max_continuation_frames(&self) -> u32
pub fn h2_max_continuation_frames(&self) -> u32
Returns the value of h2_max_continuation_frames, or the default value if h2_max_continuation_frames is unset.
Sourcepub fn h2_max_glitch_count(&self) -> u32
pub fn h2_max_glitch_count(&self) -> u32
Returns the value of h2_max_glitch_count, or the default value if h2_max_glitch_count is unset.
Sourcepub fn h2_initial_connection_window(&self) -> u32
pub fn h2_initial_connection_window(&self) -> u32
Returns the value of h2_initial_connection_window, or the default value if h2_initial_connection_window is unset.
Sourcepub fn h2_max_concurrent_streams(&self) -> u32
pub fn h2_max_concurrent_streams(&self) -> u32
Returns the value of h2_max_concurrent_streams, or the default value if h2_max_concurrent_streams is unset.
Sourcepub fn h2_stream_shrink_ratio(&self) -> u32
pub fn h2_stream_shrink_ratio(&self) -> u32
Returns the value of h2_stream_shrink_ratio, or the default value if h2_stream_shrink_ratio is unset.
Sourcepub fn h2_max_rst_stream_lifetime(&self) -> u64
pub fn h2_max_rst_stream_lifetime(&self) -> u64
Returns the value of h2_max_rst_stream_lifetime, or the default value if h2_max_rst_stream_lifetime is unset.
Sourcepub fn h2_max_rst_stream_abusive_lifetime(&self) -> u64
pub fn h2_max_rst_stream_abusive_lifetime(&self) -> u64
Returns the value of h2_max_rst_stream_abusive_lifetime, or the default value if h2_max_rst_stream_abusive_lifetime is unset.
Sourcepub fn h2_max_header_list_size(&self) -> u32
pub fn h2_max_header_list_size(&self) -> u32
Returns the value of h2_max_header_list_size, or the default value if h2_max_header_list_size is unset.
Sourcepub fn h2_stream_idle_timeout_seconds(&self) -> u32
pub fn h2_stream_idle_timeout_seconds(&self) -> u32
Returns the value of h2_stream_idle_timeout_seconds, or the default value if h2_stream_idle_timeout_seconds is unset.
Sourcepub fn h2_max_header_table_size(&self) -> u32
pub fn h2_max_header_table_size(&self) -> u32
Returns the value of h2_max_header_table_size, or the default value if h2_max_header_table_size is unset.
Sourcepub fn h2_max_rst_stream_emitted_lifetime(&self) -> u64
pub fn h2_max_rst_stream_emitted_lifetime(&self) -> u64
Returns the value of h2_max_rst_stream_emitted_lifetime, or the default value if h2_max_rst_stream_emitted_lifetime is unset.
Sourcepub fn h2_graceful_shutdown_deadline_seconds(&self) -> u32
pub fn h2_graceful_shutdown_deadline_seconds(&self) -> u32
Returns the value of h2_graceful_shutdown_deadline_seconds, or the default value if h2_graceful_shutdown_deadline_seconds is unset.
Sourcepub fn h2_max_window_update_stream0_per_window(&self) -> u32
pub fn h2_max_window_update_stream0_per_window(&self) -> u32
Returns the value of h2_max_window_update_stream0_per_window, or the default value if h2_max_window_update_stream0_per_window is unset.
Sourcepub fn sozu_id_header(&self) -> &str
pub fn sozu_id_header(&self) -> &str
Returns the value of sozu_id_header, or the default value if sozu_id_header is unset.
Sourcepub fn elide_x_real_ip(&self) -> bool
pub fn elide_x_real_ip(&self) -> bool
Returns the value of elide_x_real_ip, or the default value if elide_x_real_ip is unset.
Sourcepub fn send_x_real_ip(&self) -> bool
pub fn send_x_real_ip(&self) -> bool
Returns the value of send_x_real_ip, or the default value if send_x_real_ip is unset.
Trait Implementations§
Source§impl Clone for HttpListenerConfig
impl Clone for HttpListenerConfig
Source§fn clone(&self) -> HttpListenerConfig
fn clone(&self) -> HttpListenerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HttpListenerConfig
impl Debug for HttpListenerConfig
Source§impl Default for HttpListenerConfig
impl Default for HttpListenerConfig
Source§fn default() -> HttpListenerConfig
fn default() -> HttpListenerConfig
Source§impl<'de> Deserialize<'de> for HttpListenerConfig
impl<'de> Deserialize<'de> for HttpListenerConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<HttpListenerConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<HttpListenerConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for HttpListenerConfig
impl Display for HttpListenerConfig
Source§impl Hash for HttpListenerConfig
impl Hash for HttpListenerConfig
Source§impl Message for HttpListenerConfig
impl Message for HttpListenerConfig
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl Ord for HttpListenerConfig
impl Ord for HttpListenerConfig
Source§fn cmp(&self, other: &HttpListenerConfig) -> Ordering
fn cmp(&self, other: &HttpListenerConfig) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for HttpListenerConfig
impl PartialEq for HttpListenerConfig
Source§fn eq(&self, other: &HttpListenerConfig) -> bool
fn eq(&self, other: &HttpListenerConfig) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for HttpListenerConfig
impl PartialOrd for HttpListenerConfig
Source§impl Serialize for HttpListenerConfig
impl Serialize for HttpListenerConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for HttpListenerConfig
impl StructuralPartialEq for HttpListenerConfig
Auto Trait Implementations§
impl Freeze for HttpListenerConfig
impl RefUnwindSafe for HttpListenerConfig
impl Send for HttpListenerConfig
impl Sync for HttpListenerConfig
impl Unpin for HttpListenerConfig
impl UnsafeUnpin for HttpListenerConfig
impl UnwindSafe for HttpListenerConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.