Skip to main content

get_private_ip

Function get_private_ip 

Source
pub fn get_private_ip() -> Option<IpAddr>
Expand description

Get the primary local private IPv4 address.

This function queries the OS routing table by creating a connectionless UDP socket and connecting it to a public destination. No network packets are sent.