[minor] Improve the reliability of the port number extraction when `url.port` is undefined
Merge pull request #220 from lpinca/fix/port-extraction

Improve the reliability of the port number extraction when `url.port` is undefined