def parse_address(address, port=None):
    """
    Return a (host, port) tuple based on the config value.
    """
    try:
        address, port = address.split(':', 1)
    except ValueError:
        pass
    if port:
        port = int(port)
    return address, port
