Skip to content

Commit 26c4c43

Browse files
committed
[fix] proxying to https
1 parent 3c91ed3 commit 26c4c43

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/caronte/passes/web.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ function XHeaders(req, res, options) {
8686

8787
function stream(req, res, options) {
8888
if(options.forward) {
89-
var forwardReq = (options.ssl ? https : http).request(
89+
var forwardReq = (options.target.protocol === 'https:' ? https : http).request(
9090
common.setupOutgoing(options.ssl || {}, options, req, 'forward')
9191
);
9292
req.pipe(forwardReq);
9393
return res.end();
9494
}
9595

96-
var proxyReq = (options.ssl ? https : http).request(
96+
var proxyReq = (options.target.protocol === 'https:' ? https : http).request(
9797
common.setupOutgoing(options.ssl || {}, options, req)
9898
);
9999

lib/caronte/passes/ws.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function XHeaders(req, socket, options) {
7474
*/
7575
function stream(req, socket, options, head) {
7676
common.setupSocket(socket);
77-
77+
console.log(options.target.protocol);
7878
var proxyReq = (~['https:', 'wss:'].indexOf(options.target.protocol) ? https : http).request(
7979
common.setupOutgoing(options.ssl || {}, options, req)
8080
);

0 commit comments

Comments
 (0)