From 69276c8eba49f4276ed95a38d29cf05703af7336 Mon Sep 17 00:00:00 2001 From: Vsevolod Strukchinsky Date: Fri, 9 Jan 2015 21:29:02 +0500 Subject: [PATCH] Use infinity-agent if defaultMaxSockets is 5 --- package.json | 2 +- readme.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 62078d9..8d7ae7c 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ ], "dependencies": { "duplexify": "^3.2.0", - "infinity-agent": "^0.1.0", + "infinity-agent": "^0.2.0", "isstream": "^0.1.1", "object-assign": "^2.0.0", "prepend-http": "^1.0.0", diff --git a/readme.md b/readme.md index 0a47496..800b401 100644 --- a/readme.md +++ b/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. -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).