Skip to main content

Module client_ip

Module client_ip 

Source
Expand description

Axum extractor that resolves the real client IP address, honouring X-Forwarded-For or Forwarded only when the direct peer is in the configured trusted_proxies list.

Every proxy in that list is assumed to strip and replace any client-supplied X-Forwarded-For / Forwarded header rather than append to it. See crate::config::Config::trusted_proxies for the full security contract — without that assumption the extractor cannot tell a spoofed loopback / private / link-local entry from a real client.

Structs§

ClientIp
Resolved client IP address, ready for logging or storage in the sessions row.