Expand description
Network address helpers.
The module centralizes small network parsing rules shared by Aster services: loopback host
detection, trusted proxy CIDR parsing, and real-client-IP selection from X-Forwarded-For.
Header-framework adapters stay in application crates; this module accepts plain strings and
standard address types so it remains independent of Actix, Axum, or Hyper.
Functionsยง
- is_
loopback_ host - Returns whether
hostis localhost or a loopback IP address. - is_
trusted_ proxy - Returns whether
ipis covered by the trusted proxy list. - parse_
trusted_ proxies - Parses trusted proxy entries as CIDR networks or single IP addresses.
- real_
ip_ from_ forwarded_ for - Returns the first client IP from
X-Forwarded-Foronly whenpeeris trusted.