pub fn get_client_ip(headers: &HeaderMap, extensions: &Extensions) -> StringExpand description
Extracts the client IP address from HTTP headers and extensions.
This function checks headers in order of priority:
- X-Forwarded-For (leftmost IP is the original client when behind proxies)
- X-Real-IP (used by some proxies like nginx)
- Socket address from extensions (direct connection)
Returns “unknown” if no IP can be extracted.