luxon.utils.uri.
parse_host
(host, default_port=None)[source]¶Parse a canonical ‘host:port’ string into parts.
Parse a host string (which may or may not contain a port) into parts, taking into account that the string may contain either a domain name or an IP address. In the latter case, both IPv4 and IPv6 addresses are supported.
Parameters: |
|
---|---|
Returns: | A parsed (host, port) tuple from the given
host string, with the port converted to an |
Return type: | tuple |