Skip to main content

real_ip_from_headers

Function real_ip_from_headers 

Source
pub fn real_ip_from_headers(
    headers: &HeaderMap,
    peer: IpAddr,
    trusted_proxies: &[String],
) -> IpAddr
Expand description

Resolves the client IP from Actix headers, a direct peer IP, and raw trusted proxy entries.

X-Forwarded-For is trusted only when peer is covered by the trusted proxy list. Invalid trusted proxy entries are skipped by aster_forge_utils::net::parse_trusted_proxies.