-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
feat: you can now supply your own HTTP agent to a web3.js Connection #29125
Merged
steveluscher
merged 4 commits into
solana-labs:master
from
steveluscher:injectable-http-agent
Dec 6, 2022
Merged
feat: you can now supply your own HTTP agent to a web3.js Connection #29125
steveluscher
merged 4 commits into
solana-labs:master
from
steveluscher:injectable-http-agent
Dec 6, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## master #29125 +/- ##
=========================================
- Coverage 77.1% 76.7% -0.5%
=========================================
Files 55 55
Lines 2934 3140 +206
Branches 408 472 +64
=========================================
+ Hits 2264 2410 +146
- Misses 529 565 +36
- Partials 141 165 +24 |
This was referenced Dec 6, 2022
gnapoli23
pushed a commit
to gnapoli23/solana
that referenced
this pull request
Dec 16, 2022
…olana-labs#29125) * You can now supply your own `https?.Agent` when creating a `Connection` object * Don't use HTTP agents in test mode * Tests that assert the behaviour of the `agentOverride` config of `Connection` * s/agentOverride/httpAgent/ is less confusing when the value is `false`
This was referenced Dec 28, 2022
nickfrosty
pushed a commit
to nickfrosty/solana
that referenced
this pull request
Jan 4, 2023
…olana-labs#29125) * You can now supply your own `https?.Agent` when creating a `Connection` object * Don't use HTTP agents in test mode * Tests that assert the behaviour of the `agentOverride` config of `Connection` * s/agentOverride/httpAgent/ is less confusing when the value is `false`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
There are folks who have good reasons to want to disable or override our default HTTP agent (ie. the thing that implements connection persistence in Node for the RPC). This PR keeps the behaviour of creating the usual default
http.Agent
, but offers config to disable or override it.Disable it
Supply your own
Note, that if you supply your own, it's up to you to dispose of the agent when the connection is no longer needed.
Summary of Changes
httpAgent
config parameter toConnection
process.env.NODE_ENV
istest
.Fixes #25069.