Skip to content
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

simple api for managing agent (e.g. maxSockets) #73

Closed
max-mapper opened this issue Jun 23, 2015 · 3 comments
Closed

simple api for managing agent (e.g. maxSockets) #73

max-mapper opened this issue Jun 23, 2015 · 3 comments
Milestone

Comments

@max-mapper
Copy link

right now I can require('got') and require('http') to do e.g. var agent = new http.Agent({ maxSockets: 1 }) and then pass in the agent to the options when I do a got request, but IMO it would be nicer to not have to require('http') :)

@julien-f
Copy link
Contributor

Like an agent option which would be passed directly to new http.Agent()?

@floatdrop
Copy link
Contributor

@maxogden yeah, I stumbled upon this day ago, because got uses infinity-agent and it quite hard to configure defaultMaxSockets in it. There should be nicer way to configure got agent I guess.

Problem with agent options is that got should decide when create new Agent instance and how reuse them.

@floatdrop
Copy link
Contributor

For now I can think only of exposing infinity-agent globalAgent:

var got = require('got');
got.globalAgent.http.maxSockets = 1;

@floatdrop floatdrop added this to the 4.0.0 milestone Jul 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants