ns_parsehostport - Parse a string containing host and an optional port
This function interprets the provided string as host and optional port as defined by the authority elements in RFC 3986. The function supports IP-literal notation. The functionality is an subset of ns_parseurl.
When -strict is specified, the function performs a more thorough checking of the valid characters for the host (as defined in RFC 3986, but relaxed by errata #4942). Otherwise, the checking is kept to the bare minimum.
The resulting dict might contain the following elements: host, port.
% ns_parsehostport openacs.org:443 host openacs.org port 443 % ns_parsehostport localhost host localhost % ns_parsehostport {[ 2001:628:404:74::31]:443]} host 2001:628:404:74::31 port 443