Merge pull request #729 from lightblade/master

websocket needs to respect `options.secure` too
This commit is contained in:
Jarrett Cruger 2014-11-04 18:13:26 -05:00
commit 57329b6327

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