pub struct HttpConfig {
pub listen: SocketAddr,
pub read_timeout: Duration,
pub write_timeout: Duration,
pub max_request_size: usize,
pub access_log: bool,
pub trusted_proxies: Vec<IpNet>,
pub tls: Option<TlsConfig>,
pub h2c: bool,
pub compression: CompressionConfig,
pub hooks: Vec<HookConfig>,
}Expand description
HTTP plugin configuration.
[http]
listen = "0.0.0.0:8080"
read_timeout = "10s"
write_timeout = "30s"
max_request_size = "10mb"
access_log = false
trusted_proxies = ["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"]
h2c = false
[http.tls]
cert = "/path/to/cert.pem"
key = "/path/to/key.pem"
[http.compression]
enabled = true
algorithms = ["gzip", "br", "zstd"]
min_size = 256Fields§
§listen: SocketAddrListening address. Default: 0.0.0.0:8080
read_timeout: DurationMax time to read request body. Default: 10s
write_timeout: DurationMax time to write response. Default: 30s
max_request_size: usizeMaximum request body size. Accepts: “10mb”, “512kb”, “1gb”, or raw bytes as integer. Default: “10mb”.
access_log: boolEnable HTTP access logging (method, uri, status, duration). Default: false
trusted_proxies: Vec<IpNet>Trusted proxy subnets for X-Forwarded-For parsing. When a request comes from a trusted proxy, the real client IP is extracted from X-Forwarded-For. Default: empty (trust no proxies).
tls: Option<TlsConfig>TLS configuration. If set, the server listens on HTTPS. HTTP/2 via ALPN is negotiated automatically when TLS is enabled.
h2c: boolEnable HTTP/2 cleartext (h2c) — HTTP/2 without TLS. Default: false.
compression: CompressionConfigResponse compression. Default: disabled.
hooks: Vec<HookConfig>Lua hook pipeline. Default: empty (no hooks).
Trait Implementations§
Source§impl Clone for HttpConfig
impl Clone for HttpConfig
Source§fn clone(&self) -> HttpConfig
fn clone(&self) -> HttpConfig
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 HttpConfig
impl Debug for HttpConfig
Source§impl Default for HttpConfig
impl Default for HttpConfig
Source§impl<'de> Deserialize<'de> for HttpConfigwhere
HttpConfig: Default,
impl<'de> Deserialize<'de> for HttpConfigwhere
HttpConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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>
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