Fixed issue determining WebSocket domain when current domain contains a port.