From 40dc9dee2d1e617af7f85a056d281b4f220f2802 Mon Sep 17 00:00:00 2001 From: indexzero Date: Tue, 10 May 2011 15:29:03 -0700 Subject: [PATCH] Revert "Fixed "Invalid argument to getAgent" when proxying HTTP" This reverts commit 642e15805dbd572835bb4fee9527e4f2da658833. --- lib/node-http-proxy.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/node-http-proxy.js b/lib/node-http-proxy.js index 10b6cfcbb..9f3521c0a 100644 --- a/lib/node-http-proxy.js +++ b/lib/node-http-proxy.js @@ -45,9 +45,11 @@ exports.version = [0, 5, 0]; // and sets the `maxSockets` property appropriately. // function _getAgent (host, port, secure) { - var options = { host: host, port: port }; - var agent = !secure ? http.getAgent(options) : https.getAgent(options); - + var agent = !secure ? http.getAgent(host, port) : https.getAgent({ + host: host, + port: port + }); + agent.maxSockets = maxSockets; return agent; } @@ -666,4 +668,4 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, options if (options.buffer && !errState) { options.buffer.resume(); } -}; +}; \ No newline at end of file