diff --git a/lib/caronte/passes/ws.js b/lib/caronte/passes/ws.js index baf13a7..1fd3fd7 100644 --- a/lib/caronte/passes/ws.js +++ b/lib/caronte/passes/ws.js @@ -75,7 +75,7 @@ function XHeaders(req, socket, options) { function stream(req, socket, options, head) { common.setupSocket(socket); - var proxyReq = (options.ssl ? https : http).request( + var proxyReq = (~['https:', 'wss:'].indexOf(options.target.protocol) ? https : http).request( common.setupOutgoing(options.ssl || {}, options, req) );