diff --git a/lib/node-http-proxy.js b/lib/node-http-proxy.js index ff22317..72e8d0e 100644 --- a/lib/node-http-proxy.js +++ b/lib/node-http-proxy.js @@ -59,11 +59,12 @@ function _getAgent (host, port, secure) { if (!_agents[id]) { Agent = secure ? https.Agent : http.Agent; - _agents[id] = new Agent({ - host: host, - port: port, - maxSockets: maxSockets + _agents[id] = new Agent({ + host: host, + port: port }); + + _agents[id].maxSockets = maxSockets; } return _agents[id];