Browse Source

Merge pull request #32 from floatdrop/infinity-agent-0.2

Use infinity-agent if defaultMaxSockets is 5
http2
Sindre Sorhus 10 years ago
parent
commit
1cf18d8843
  1. 2
      package.json
  2. 2
      readme.md

2
package.json

@ -39,7 +39,7 @@
], ],
"dependencies": { "dependencies": {
"duplexify": "^3.2.0", "duplexify": "^3.2.0",
"infinity-agent": "^0.1.0", "infinity-agent": "^0.2.0",
"isstream": "^0.1.1", "isstream": "^0.1.1",
"object-assign": "^2.0.0", "object-assign": "^2.0.0",
"prepend-http": "^1.0.0", "prepend-http": "^1.0.0",

2
readme.md

@ -79,7 +79,7 @@ Milliseconds after which the request will be aborted and an error event with `ET
[http.Agent](http://nodejs.org/api/http.html#http_class_http_agent) instance. [http.Agent](http://nodejs.org/api/http.html#http_class_http_agent) instance.
Node HTTP/HTTPS [Agent in 0.10.35](https://github.com/joyent/node/blob/v0.10.35-release/lib/http.js#L1261) by default limits number of open sockets to 5 — which is a too low. By default `got` will use `new Agent({maxSockets: Infinity})` like new [`Agent` in 0.11.14](https://github.com/joyent/node/blob/v0.11.14-release/lib/_http_agent.js#L110). Node HTTP/HTTPS Agent in [0.10](https://github.com/joyent/node/blob/v0.10.35-release/lib/http.js#L1261) by default limits number of open sockets to 5 — which is a too low. If `options.agent` is not defined `got` will use [infinity-agent](https://github.com/floatdrop/infinity-agent) to backport `defaultMaxSockets` from [0.11](https://github.com/joyent/node/blob/v0.11.14-release/lib/_http_agent.js#L110).
[Why pooling is evil](https://github.com/substack/hyperquest#pooling-is-evil). [Why pooling is evil](https://github.com/substack/hyperquest#pooling-is-evil).

Loading…
Cancel
Save