Skip to main content

extract_client_ip

Function extract_client_ip 

Source
pub fn extract_client_ip(extensions: &Extensions) -> String
Expand description

Extract the client IP address from request extensions.

Returns the IP as a string, or "unknown" if ConnectInfo is not present. Requires the server to use into_make_service_with_connect_info::<SocketAddr>().