Skip to main content

extract_socket_ip

Function extract_socket_ip 

Source
pub fn extract_socket_ip<B>(request: &Request<B>) -> Option<IpAddr>
Expand description

Extract the request’s socket peer IP without inspecting HTTP fields.

With the axum feature, Axum’s ConnectInfo<SocketAddr> extension takes precedence. If it is absent, this falls back to a directly stored SocketAddr request extension. It returns None when neither extension is present and does not inspect forwarding Headers.