from typing import Tuple
import socket


def find_hostname_and_port() -> Tuple[str, int]:
    """Find available hostname/port to listen on."""
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.bind(("", 0))
    (hostname, port) = s.getsockname()
    s.close()
    return (hostname, port)