12 lines
312 B
Python
12 lines
312 B
Python
"""Utility functions for the driver."""
|
|
import socket
|
|
|
|
|
|
def get_public_ip_address():
|
|
"""Find the public IP Address of the host device."""
|
|
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
sock.connect(("8.8.8.8", 80))
|
|
public_ip = sock.getsockname()[0]
|
|
sock.close()
|
|
return public_ip
|