Skip to content

Commit

Permalink
Revert "Fixed "Invalid argument to getAgent" when proxying HTTP"
Browse files Browse the repository at this point in the history
This reverts commit 642e158.
  • Loading branch information
indexzero committed May 10, 2011
1 parent 57127a3 commit 40dc9de
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/node-http-proxy.js
Expand Up @@ -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;
}
Expand Down Expand Up @@ -666,4 +668,4 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, options
if (options.buffer && !errState) {
options.buffer.resume();
}
};
};

0 comments on commit 40dc9de

Please sign in to comment.