From d1eabccf931ec79bdafc60d97f89250fea2323af Mon Sep 17 00:00:00 2001 From: Ming Liu Date: Tue, 4 Nov 2014 14:51:34 -0800 Subject: [PATCH] websocket needs to respect `options.secure` too --- lib/http-proxy/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/http-proxy/common.js b/lib/http-proxy/common.js index 4d5b5f1..eda6b17 100644 --- a/lib/http-proxy/common.js +++ b/lib/http-proxy/common.js @@ -39,7 +39,7 @@ common.setupOutgoing = function(outgoing, options, req, forward) { extend(outgoing.headers, options.headers); } - if (options[forward || 'target'].protocol == 'https:') { + if (~['https:', 'wss:'].indexOf(options[forward || 'target'].protocol)) { outgoing.rejectUnauthorized = (typeof options.secure === "undefined") ? true : options.secure; }