def parse_hostport(hostport_str):
    """
    parse_hostport transforms a string "host:port" to a tuple of (host:str, port:int)
    Example:
        parse_hostport("localhost:12345") -> ("localhost", 12345)
    """

    host, port_str = hostport_str.split(":")
    return host.strip(), int(port_str.strip())