Skip to main content

Module client_ip

Module client_ip 

Source
Expand description

Trusted-proxy-aware HTTP header adapter. Direct peers come from the connection, never headers.

Functions§

client_ip
Resolves the request’s client IP, retaining None when connection info is missing.
direct_peer
Reads the TCP peer populated by into_make_service_with_connect_info::<SocketAddr>(). UDS or services without connection info return None; headers cannot fill this gap.
real_ip_from_headers
Resolves a client IP using raw trusted CIDRs/IPs and an explicit direct peer.
real_ip_from_trusted_headers
Resolves a client IP using parsed trusted proxies. Invalid forwarded values fall back to peer.