pub fn client_ip(
headers: &HeaderMap,
peer: Option<SocketAddr>,
trust_proxy: bool,
) -> StringExpand description
Resolve the client’s IP address for logging and rate-limit keys.
When trust_proxy is true, inspects CF-Connecting-IP, Fly-Client-IP, and the rightmost
valid IP address in X-Forwarded-For before falling back to peer. When trust_proxy is
false, proxy headers are ignored and only peer is used. Returns "unknown" when no valid
IP can be determined.