pub struct HttpConfig {
pub bind_address: SocketAddr,
pub trust_proxy_headers: bool,
pub trusted_proxies: Vec<IpNet>,
pub max_http_connections: usize,
pub header_read_timeout: Duration,
pub shutdown_timeout: DeadlineDuration,
}Fields§
§bind_address: SocketAddr§trust_proxy_headers: bool§trusted_proxies: Vec<IpNet>TCP peers permitted to supply forwarded request metadata when proxy mode is enabled.
max_http_connections: usizeMaximum accepted HTTP sockets, including upgraded WebSocket connections.
Must be positive and no greater than [tokio::sync::Semaphore::MAX_PERMITS].
header_read_timeout: DurationAcceptance-to-first-header and subsequent HTTP/1 header deadline. Must be between one second and one day.
shutdown_timeout: DeadlineDurationDeadline for listener, session, background and RTC worker drainage.
Loaded from SHUTDOWN_TIMEOUT_MS with a 10_000 default.
Implementations§
Source§impl HttpConfig
impl HttpConfig
Sourcepub(crate) fn validate(&self) -> Result<()>
pub(crate) fn validate(&self) -> Result<()>
Validates proxy policy and listener limits before runtime startup.
§Errors
Returns anyhow::Error for proxy mode without trusted proxies, zero or
unsupported semaphore capacity or a header deadline outside one second
through one day.
pub(super) fn from_env(env: &Env<'_>) -> Result<Self>
Trait Implementations§
Source§impl Clone for HttpConfig
impl Clone for HttpConfig
Source§fn clone(&self) -> HttpConfig
fn clone(&self) -> HttpConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HttpConfig
impl Debug for HttpConfig
Source§impl PartialEq for HttpConfig
impl PartialEq for HttpConfig
impl Eq for HttpConfig
impl StructuralPartialEq for HttpConfig
Auto Trait Implementations§
impl Freeze for HttpConfig
impl RefUnwindSafe for HttpConfig
impl Send for HttpConfig
impl Sync for HttpConfig
impl Unpin for HttpConfig
impl UnsafeUnpin for HttpConfig
impl UnwindSafe for HttpConfig
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more