Skip to main content

is_trusted_proxy

Function is_trusted_proxy 

Source
pub fn is_trusted_proxy(peer_ip: &str, trusted_proxy_cidrs: &str) -> bool
Expand description

Checks whether a direct peer address belongs to one of the configured CIDRs.

§Parameters

§Returns

Returns true when the condition checked by crate::http::is_trusted_proxy holds and false otherwise.

§Performance

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

§Examples

ⓘ
let _result = pharos_runtime_core::http::is_trusted_proxy("127.0.0.1", "127.0.0.1/32");
  • crate::http for adjacent helpers that share the same runtime surface.