[#1558] Corrects handling of port number in WebSockets handshake header values

* This patch was inspired by the work of @golovnin