Skip to content

Commit 40dc9de

Browse files
committed
Revert "Fixed "Invalid argument to getAgent" when proxying HTTP"
This reverts commit 642e158.
1 parent 57127a3 commit 40dc9de

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/node-http-proxy.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@ exports.version = [0, 5, 0];
4545
// and sets the `maxSockets` property appropriately.
4646
//
4747
function _getAgent (host, port, secure) {
48-
var options = { host: host, port: port };
49-
var agent = !secure ? http.getAgent(options) : https.getAgent(options);
50-
48+
var agent = !secure ? http.getAgent(host, port) : https.getAgent({
49+
host: host,
50+
port: port
51+
});
52+
5153
agent.maxSockets = maxSockets;
5254
return agent;
5355
}
@@ -666,4 +668,4 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, options
666668
if (options.buffer && !errState) {
667669
options.buffer.resume();
668670
}
669-
};
671+
};

0 commit comments

Comments
 (0)