websocket needs to respect options.secure too

This commit is contained in:
Ming Liu 2014-11-04 14:51:34 -08:00
parent 60bd697051
commit d1eabccf93

View File

@ -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;
}