Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

feat: allow passing a http.Agent to ipfs-http-client in node #3474

Merged
merged 13 commits into from
Jan 13, 2021

Commits on Jan 12, 2021

  1. 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
    achingbrain committed Jan 12, 2021
    Configuration menu
    Copy the full SHA
    ad06960 View commit details
    Browse the repository at this point in the history
  2. chore: slow ci is slow

    achingbrain committed Jan 12, 2021
    Configuration menu
    Copy the full SHA
    e65c2f0 View commit details
    Browse the repository at this point in the history
  3. chore: remove node check

    achingbrain committed Jan 12, 2021
    Configuration menu
    Copy the full SHA
    7799644 View commit details
    Browse the repository at this point in the history

Commits on Jan 13, 2021

  1. Configuration menu
    Copy the full SHA
    876b965 View commit details
    Browse the repository at this point in the history
  2. chore: more logging

    achingbrain committed Jan 13, 2021
    Configuration menu
    Copy the full SHA
    e9279f3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ac7c333 View commit details
    Browse the repository at this point in the history
  4. chore: add debug

    achingbrain committed Jan 13, 2021
    Configuration menu
    Copy the full SHA
    48a8b05 View commit details
    Browse the repository at this point in the history
  5. chore: add temp delay

    achingbrain committed Jan 13, 2021
    Configuration menu
    Copy the full SHA
    567af01 View commit details
    Browse the repository at this point in the history
  6. chore: add log

    achingbrain committed Jan 13, 2021
    Configuration menu
    Copy the full SHA
    19ebbf8 View commit details
    Browse the repository at this point in the history
  7. chore: linting

    achingbrain committed Jan 13, 2021
    Configuration menu
    Copy the full SHA
    a28081e View commit details
    Browse the repository at this point in the history
  8. chore: try http client

    achingbrain committed Jan 13, 2021
    Configuration menu
    Copy the full SHA
    07aa1ed View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    a1e17ef View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    aab850b View commit details
    Browse the repository at this point in the history