From 26c4c43a06263ec6721bc0e8a90644297d0cf217 Mon Sep 17 00:00:00 2001 From: yawnt Date: Sun, 15 Sep 2013 13:06:39 +0200 Subject: [PATCH] [fix] proxying to https --- lib/caronte/passes/web.js | 4 ++-- lib/caronte/passes/ws.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/caronte/passes/web.js b/lib/caronte/passes/web.js index 64ee287..8c70a6e 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 1fd3fd7..a143866 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) );