bpod_core.misc.get_local_ipv4
- bpod_core.misc.get_local_ipv4() str
Determine the primary local IPv4 address of the machine.
This function attempts to determine the IPv4 address of the local machine that would be used for an outbound connection to the internet. It does this by creating a UDP socket and connecting to a known public IP address (Google DNS at 8.8.8.8). No data is sent, but the OS uses the routing table to select the appropriate local interface.