Merge pull request #323 from indutny/fix-maciej-issue

lib: allow overriding maxSockets
This commit is contained in:
Maciej Małecki 2012-10-25 18:13:59 -07:00
commit 3d618777ea

View File

@ -352,6 +352,9 @@ exports._getAgent = function _getAgent (options) {
var Agent = options.https ? https.Agent : http.Agent, var Agent = options.https ? https.Agent : http.Agent,
agent; agent;
// require('http-proxy').setMaxSockets() should override http's default
// configuration value (which is pretty low).
options.maxSockets = options.maxSockets || maxSockets;
agent = new Agent(options); agent = new Agent(options);
return agent; return agent;