Skip to main content

extract_real_ip_from_headers

Function extract_real_ip_from_headers 

Source
pub fn extract_real_ip_from_headers(
    headers: &str,
    peer_info: Option<&str>,
    trusted_proxy: bool,
) -> Option<String>
Expand description

Selects the real client IP from trusted forwarded headers or peer data.

§Parameters

§Returns

Returns Some when crate::http::extract_real_ip_from_headers can produce a value and None otherwise.

§Performance

Performance is proportional to the size of the supplied inputs and any parsed or loaded data consumed by crate::http::extract_real_ip_from_headers.

§Examples

ⓘ
let _result = pharos_runtime_core::http::extract_real_ip_from_headers("host: example", todo!(), todo!());
  • crate::http for adjacent helpers that share the same runtime surface.