Skip to main content

is_localhost_addr

Function is_localhost_addr 

Source
pub fn is_localhost_addr(addr: SocketAddr) -> bool
Expand description

Validate that a socket address is localhost only.

Returns true only for 127.0.0.1 (IPv4) or ::1 (IPv6). Returns false for 0.0.0.0, [::], or any non-loopback address.