pub struct ServerConfig {
pub host: String,
pub port: u16,
pub trusted_proxies: Vec<String>,
pub trusted_proxy_cidrs: Vec<String>,
}Fields§
§host: String§port: u16§trusted_proxies: Vec<String>Trusted reverse-proxy IPs whose X-Forwarded-For header is
honoured for client-IP attribution. Empty (default) =
X-Forwarded-For is ignored and the direct TCP peer is used —
safe behind nothing or behind a CDN that strips XFF, but
wrong behind a load balancer (every request appears to come
from the LB, so per-IP rate limits become a global cap).
Configure with the IPs of your reverse proxies (e.g.
["10.0.0.1", "10.0.0.2"]) to opt in.
trusted_proxy_cidrs: Vec<String>Trusted reverse-proxy CIDRs whose Forwarded (RFC 7239) and
X-Forwarded-Host headers are honoured for request host /
domain detection (multi-domain feature, T19). Distinct from
trusted_proxies above: that one is for client-IP
attribution; this one is for which host the request is
claiming to address. Outside this set, the daemon always uses
the literal Host header.
Empty (default) disables Forwarded / X-Forwarded-Host
trust — appropriate for deployments not behind a reverse
proxy. CIDRs accept 1.2.3.0/24 or 2001:db8::/32.
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more