Expand description
Best-effort extraction of raw client IP assertions.
extract_client_ip uses CLIENT_IP_HEADERS, while
extract_client_ip_with_headers lets callers choose the fields and their
order explicitly using ClientIpHeader values.
Both functions only inspect HTTP fields. They cannot authenticate the
sender, so their results remain raw and untrusted. Applications must
establish the relevant proxy or CDN trust boundary before using a result
for authorization, abuse prevention, or rate limiting.
RFC 7239 standardizes Forwarded; X-Forwarded-For and the single-value
provider/proxy fields are de facto conventions rather than IETF standards.
No standard defines precedence between these different field names.
Enums§
- Client
IpHeader - A supported client IP Header and its parsing rule.
Constants§
- CLIENT_
IP_ HEADERS - The default Header lookup order used by
extract_client_ip.
Functions§
- extract_
axum_ peer_ address - Extract the Axum transport peer stored in a request extension.
- extract_
axum_ peer_ ip - Extract the Axum socket peer IP stored in a request extension.
- extract_
client_ ip - Extract a raw client IP assertion using the default field order.
- extract_
client_ ip_ with_ headers - Extract a raw client IP assertion using caller-defined fields and order.
- extract_
peer_ address - Return a transport peer address supplied out-of-band by an adapter.
- extract_
peer_ ip - Return the IP address of a transport peer supplied out-of-band by an adapter.