Expand description
LAN IP address detection for the reverse proxy.
Detects the local IPv4 address used for the default route by opening a UDP
“connection” to a public address (1.1.1.1:53). No data is sent; the OS
routing table determines which local address to use, and we read it back
via socket.local_addr().
On Unix, falls back to interface enumeration via nix::ifaddrs when the UDP
probe fails (e.g. no route to the internet). On Windows, only the UDP
probe is available.
Functions§
- detect_
lan_ ip - Detect the LAN IPv4 address of the default outbound route.
- detect_
lan_ ip_ if_ changed - Detect LAN IP, returning
Noneif it hasn’t changed sincelast.