Skip to main content

Module net

Module net 

Source
Expand description

Picking the local IP address other devices should use to reach us.

Functionsยง

host_ip
A best-guess LAN address of this host, used when no route-based answer is available. Prefers 192.168.x.x, then other private ranges, then any non-loopback address; within a class the smallest address wins, which usually skips VM bridges like 192.168.65.1.
local_ip_for
The address peer should use to reach this host.
local_ip_towards
The local IPv4 address used to route packets to target. No packet is sent: connecting a UDP socket only selects a route.