diff --git a/lib/caronte/passes/web.js b/lib/caronte/passes/web.js index 64ee2875c..8c70a6e1a 100644 --- a/lib/caronte/passes/web.js +++ b/lib/caronte/passes/web.js @@ -86,14 +86,14 @@ function XHeaders(req, res, options) { function stream(req, res, options) { if(options.forward) { - var forwardReq = (options.ssl ? https : http).request( + var forwardReq = (options.target.protocol === 'https:' ? https : http).request( common.setupOutgoing(options.ssl || {}, options, req, 'forward') ); req.pipe(forwardReq); return res.end(); } - var proxyReq = (options.ssl ? https : http).request( + var proxyReq = (options.target.protocol === 'https:' ? https : http).request( common.setupOutgoing(options.ssl || {}, options, req) ); diff --git a/lib/caronte/passes/ws.js b/lib/caronte/passes/ws.js index 1fd3fd780..a14386666 100644 --- a/lib/caronte/passes/ws.js +++ b/lib/caronte/passes/ws.js @@ -74,7 +74,7 @@ function XHeaders(req, socket, options) { */ function stream(req, socket, options, head) { common.setupSocket(socket); - + console.log(options.target.protocol); var proxyReq = (~['https:', 'wss:'].indexOf(options.target.protocol) ? https : http).request( common.setupOutgoing(options.ssl || {}, options, req) );