akkudoktoreos.server.server.get_host_ip
- akkudoktoreos.server.server.get_host_ip() str
IP address of the host machine.
This function determines the IP address used to communicate with the outside world (e.g., for internet access), without sending any actual data. It does so by opening a UDP socket connection to a public IP address (Google DNS).
- Returns:
The local IP address as a string. Returns ‘127.0.0.1’ if unable to determine.
- Return type:
str
Example
>>> get_host_ip() '192.168.1.42'