Function local_ip_address::local_ip[][src]

pub fn local_ip() -> Result<IpAddr, Error>
Expand description

Retrieves the local ip address of the machine in the local network from the AF_INET family.

A different approach is taken based on the operative system.

For linux based systems the Netlink socket communication is used to retrieve the local network interface.

For macOS systems the getifaddrs approach is taken using libc

For Windows systems Win32’s IP Helper is used to gather the Local IP address