Skip to main content

Module client_ip_headers

Module client_ip_headers 

Source
Expand description

Direct extraction of common single-value client IP fields.

Each function parses exactly one provider or proxy field and returns its raw asserted IpAddr. CF-Connecting-IP, CloudFront-Viewer-Address, Fly-Client-IP, True-Client-IP, X-Envoy-External-Address, and X-Real-IP are vendor or de facto conventions, not IETF standards.

These values are untrusted: this module does not authenticate a proxy or apply a trust policy. The feature-gated client_ip::extract_client_ip convenience includes selected fields, but its output remains untrusted. Applications must decide whether a specific field is trustworthy for their deployment. Every extractor treats the field as singular: absence returns None, while duplicate, non-text, empty, or malformed values return a value-redacting error.

Functions§

extract_header_cf_connecting_ip
Extract the raw, untrusted IP asserted by CF-Connecting-IP.
extract_header_cloudfront_viewer_address
Extract an untrusted client IP from AWS CloudFront’s CloudFront-Viewer-Address IP:port value.
extract_header_fly_client_ip
Extract the raw, untrusted IP asserted by Fly-Client-IP.
extract_header_true_client_ip
Extract an untrusted client IP asserted by True-Client-IP.
extract_header_x_envoy_external_address
Extract an untrusted client IP asserted by Envoy’s X-Envoy-External-Address.
extract_header_x_real_ip
Extract the raw, untrusted IP asserted by X-Real-IP.
extract_request_cf_connecting_ip
Extract CF-Connecting-IP from a complete request.
extract_request_cloudfront_viewer_address
Extract CloudFront-Viewer-Address from a complete request.
extract_request_fly_client_ip
Extract Fly-Client-IP from a complete request.
extract_request_true_client_ip
Extract True-Client-IP from a complete request.
extract_request_x_envoy_external_address
Extract X-Envoy-External-Address from a complete request.
extract_request_x_real_ip
Extract X-Real-IP from a complete request.