from typing import Tuple


def _parse_broker(broker: str) -> Tuple[str, int]:
    """Parse a host:port string and return its components."""

    errmsg: str = "bad broker; use host:port"
    host, *port_list = broker.split(':')

    if not host:
        raise Exception(errmsg)

    if not port_list:
        return (host, 1883)

    if len(port_list) == 1:
        port = int(port_list[0])
        if port < 1 or port > 65535:
            raise Exception(errmsg)
        return (host, port)

    raise Exception(errmsg)