Replies: 3 comments
-
If you think the following code is too complicated, here is the alternative approach to add proxy support #4337 |
Beta Was this translation helpful? Give feedback.
0 replies
-
666 |
Beta Was this translation helpful? Give feedback.
0 replies
-
I read the source and just add this code before init provider,it will be work FetchRequest.registerGetUrl(
FetchRequest.createGetUrlFunc({
agent: new HttpsProxyAgent(HTTP_PROXY),
})
); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is currently undocumented and since this method is available since V6, will leave the sample code here
https://github.com/kaliubuntu0206/ethers-proxy-example
https://github.com/kaliubuntu0206/ethers-proxy-example/blob/main/index.js
Requires latest ethers.js version (v6.8.0) to make it work
Reference:
https://docs.ethers.org/v6/api/utils/fetching/#FetchRequest_registerGetUrl
https://docs.ethers.org/v6/api/utils/fetching/#FetchGetUrlFunc
Example code:
Related issues:
#4178
#3655
#3644
#4173
#3625
#2829
Beta Was this translation helpful? Give feedback.
All reactions