mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
Fixed "Invalid argument to getAgent" when proxying HTTP
This commit is contained in:
parent
ddf31b22ec
commit
642e15805d
@ -45,10 +45,8 @@ exports.version = [0, 5, 0];
|
|||||||
// and sets the `maxSockets` property appropriately.
|
// and sets the `maxSockets` property appropriately.
|
||||||
//
|
//
|
||||||
function _getAgent (host, port, secure) {
|
function _getAgent (host, port, secure) {
|
||||||
var agent = !secure ? http.getAgent(host, port) : https.getAgent({
|
var options = { host: host, port: port };
|
||||||
host: host,
|
var agent = !secure ? http.getAgent(options) : https.getAgent(options);
|
||||||
port: port
|
|
||||||
});
|
|
||||||
|
|
||||||
agent.maxSockets = maxSockets;
|
agent.maxSockets = maxSockets;
|
||||||
return agent;
|
return agent;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user