pub struct HttpListenerConfig {Show 35 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>,
pub h2_max_header_fields: Option<u32>,
pub interface: Option<String>,
pub forwarded_headers: Option<i32>,
pub h2_stream_refusal_percent: Option<u32>,
}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: 16777216 (16 MiB). Credit is returned per half window received.
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>Floor of the connection-lifetime cap on RST_STREAM frames received (CVE-2023-44487): trips once the count exceeds this value and the resets received after a response started or on a closed stream exceed the streams a backend answered on the connection. Default: 200000.
h2_max_rst_stream_abusive_lifetime: Option<u64>Floor of the cap on “abusive” (pre-response-start) RST_STREAM frames received on a frontend H2 connection — the Rapid Reset signature: trips once the count exceeds this value and more than half of the backend-routed streams were reset before their response. Default: 1000.
h2_max_rst_stream_emitted_lifetime: Option<u64>Floor of the cap on RST_STREAM frames emitted by the server that
the peer provoked (CVE-2025-8671 “MadeYouReset”): trips once the count
exceeds this value and more than half of the
backend-routed streams were reset before their response. 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. Resets Sōzu
decides on its own (idle CANCEL, REFUSED_STREAM, STREAM_CLOSED,
backend-failure INTERNAL_ERROR) and NoError resets are not counted.
Default: 10000.
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. Unset, it inherits
back_timeout, floored at 30 (so 30 with the default back_timeout);
an explicit value wins, 0 meaning 1.
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 unsolicited connection-level (stream 0) WINDOW_UPDATE frames per second window. Each DATA frame the proxy sends entitles the peer to two that are not counted; only the excess counts. 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: 2000.
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.
h2_max_header_fields: Option<u32>Maximum number of materialized header fields per request — HPACK fields plus expanded cookie crumbs (RFC 9113 §8.2.3). Bounds the HPACK indexed-reference header bomb, where 1-byte indexed references are amplified into per-entry bookkeeping. Default: 128.
interface: Option<String>Name of the network interface (e.g. “wg0”) the listening socket is
bound to with SO_BINDTODEVICE, set before bind(). Linux only: the
configuration loader refuses the key on any other platform. Part of the
listener identity together with address, so two listeners may share an
address on different interfaces. Absent = not bound to an interface (the
historical behaviour). Not patchable: changing it needs a rebind, so it
is absent from the Update*ListenerConfig patches.
forwarded_headers: Option<i32>Which forwarding header family is added to every forwarded request:
X-Forwarded-*, RFC 7239 Forwarded, both, or none. Independent of
elide_x_real_ip and send_x_real_ip. Default: both.
h2_stream_refusal_percent: Option<u32>Share, in percent, of the pre-response RST_STREAM cap’s floor (h2_max_rst_stream_abusive_lifetime) at which an H2 connection refuses new client streams with RST_STREAM(REFUSED_STREAM), retryable per RFC 9113 §8.7, and keeps serving its open streams. The cap itself still ends the connection with GOAWAY(ENHANCE_YOUR_CALM). 0 disables the soft state; 100 or more never engages it before the cap. Default: 50.
Implementations§
Source§impl HttpListenerConfig
impl HttpListenerConfig
Sourcepub fn listener_key(&self) -> ListenerKey
pub fn listener_key(&self) -> ListenerKey
The identity of the listener this message configures or targets.
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.
Sourcepub fn h2_max_header_fields(&self) -> u32
pub fn h2_max_header_fields(&self) -> u32
Returns the value of h2_max_header_fields, or the default value if h2_max_header_fields is unset.
Sourcepub fn interface(&self) -> &str
pub fn interface(&self) -> &str
Returns the value of interface, or the default value if interface is unset.
Sourcepub fn forwarded_headers(&self) -> ForwardedHeaders
pub fn forwarded_headers(&self) -> ForwardedHeaders
Returns the enum value of forwarded_headers, or the default if the field is unset or set to an invalid enum value.
Sourcepub fn set_forwarded_headers(&mut self, value: ForwardedHeaders)
pub fn set_forwarded_headers(&mut self, value: ForwardedHeaders)
Sets forwarded_headers to the provided enum value.
Sourcepub fn h2_stream_refusal_percent(&self) -> u32
pub fn h2_stream_refusal_percent(&self) -> u32
Returns the value of h2_stream_refusal_percent, or the default value if h2_stream_refusal_percent 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
impl Eq 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,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for HttpListenerConfig
impl PartialEq for HttpListenerConfig
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 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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.