This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: allow passing a http.Agent to ipfs-http-client in node #3474
Merged
Commits on Jan 12, 2021
-
feat: allow passing a http.Agent to ipfs-http-client in node
Right now no `http.Agent` is used for requests made using the http client in node, which means each request opens a new connection which can end up hitting process resource limits which means connections get dropped. The change here sets a default `http.Agent` with a `keepAlive: true` and `maxSockets` of 6 which is consistent with [browsers](https://tools.ietf.org/html/rfc2616#section-8.1.4) and [native apps](https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration/1407597-httpmaximumconnectionsperhost?language=objc). The user can override the agent passed to the ipfs-http-client constructor to restore the previous functionality: ``` const http = require('http') const createClient = require('ipfs-http-client') const client = createClient({ url: 'http://127.0.0.1:5002', agent: new http.Agent({ keepAlive: false, maxSockets: Infinity }) }) ``` Refs: #3464
Configuration menu - View commit details
-
Copy full SHA for ad06960 - Browse repository at this point
Copy the full SHA ad06960View commit details -
Configuration menu - View commit details
-
Copy full SHA for e65c2f0 - Browse repository at this point
Copy the full SHA e65c2f0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7799644 - Browse repository at this point
Copy the full SHA 7799644View commit details
Commits on Jan 13, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 876b965 - Browse repository at this point
Copy the full SHA 876b965View commit details -
Configuration menu - View commit details
-
Copy full SHA for e9279f3 - Browse repository at this point
Copy the full SHA e9279f3View commit details -
Configuration menu - View commit details
-
Copy full SHA for ac7c333 - Browse repository at this point
Copy the full SHA ac7c333View commit details -
Configuration menu - View commit details
-
Copy full SHA for 48a8b05 - Browse repository at this point
Copy the full SHA 48a8b05View commit details -
Configuration menu - View commit details
-
Copy full SHA for 567af01 - Browse repository at this point
Copy the full SHA 567af01View commit details -
Configuration menu - View commit details
-
Copy full SHA for 19ebbf8 - Browse repository at this point
Copy the full SHA 19ebbf8View commit details -
Configuration menu - View commit details
-
Copy full SHA for a28081e - Browse repository at this point
Copy the full SHA a28081eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 07aa1ed - Browse repository at this point
Copy the full SHA 07aa1edView commit details -
Configuration menu - View commit details
-
Copy full SHA for a1e17ef - Browse repository at this point
Copy the full SHA a1e17efView commit details -
Configuration menu - View commit details
-
Copy full SHA for aab850b - Browse repository at this point
Copy the full SHA aab850bView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.