Skip to content

Commit

Permalink
[fix] proxying to https
Browse files Browse the repository at this point in the history
  • Loading branch information
yawnt committed Sep 15, 2013
1 parent 3c91ed3 commit 26c4c43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/caronte/passes/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
);

Expand Down
2 changes: 1 addition & 1 deletion lib/caronte/passes/ws.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
);
Expand Down

0 comments on commit 26c4c43

Please sign in to comment.