diff --git a/lib/WebSocketClient.js b/lib/WebSocketClient.js index 18c2b1d3..3b24beb8 100644 --- a/lib/WebSocketClient.js +++ b/lib/WebSocketClient.js @@ -181,7 +181,7 @@ WebSocketClient.prototype.connect = function(requestUrl, protocols, origin, head 'Connection': 'Upgrade', 'Sec-WebSocket-Version': this.config.webSocketVersion.toString(10), 'Sec-WebSocket-Key': this.base64nonce, - 'Host': hostHeaderValue + 'Host': reqHeaders.Host || hostHeaderValue }); if (this.protocols.length > 0) {