-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removed Http(s) globalAgent settings #1458
Conversation
Simply passing maxSockets to Nipple did not take advantage of connection pooling benefits. Rewrote to create Agent within Hapi and pass that for requests. |
@@ -190,8 +190,8 @@ exports = module.exports = internals.Server = function (/* host, port, options * | |||
} | |||
|
|||
if (this.settings.maxSockets !== null) { | |||
Https.globalAgent.maxSockets = this.settings.maxSockets; | |||
Http.globalAgent.maxSockets = this.settings.maxSockets; | |||
this.settings.agent = (this.settings.tls ? new Https.Agent() : new Http.Agent()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong. The agent type has nothing to do with the server type. What we need is to create both agents.
Removed Http(s) globalAgent settings
@@ -122,7 +122,8 @@ internals.serverSchema = { | |||
views: internals.viewSchema({ | |||
engines: Joi.object().required() | |||
}), | |||
maxSockets: Joi.number().allow(null) | |||
maxSockets: Joi.number().allow(null), | |||
agent: Joi.object().allow(null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even the way you had it, there is no need to allow agent as an external option.
Offloaded maxSockets settings to Nipple. Closes #1346