Replies: 1 comment 2 replies
-
Hey! You can also do it the other way around. When instantiating When setting a An example might be: let pool;
setGlobalDispatcher(
new ProxyAgent({
uri: 'http://127.0.0.1:8080',
factory: (...args) => {
pool = new Pool(...args)
return pool;
},
})
)
// dummy request to trigger the factory
await fetch('https://httpstat.us').then(r => r.blob()) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Might be related to #1957 but I'm not 100% sure.
Let's say I have a following piece of code:
Works just fine. Now I have an app that is connecting through the proxy:
How to configure the Pool in a way that all the connections are initiated through the proxy configured globally? I've tried something like this:
But then the pooling is overriden by the defaults of ProxyAgent.
The hacky way I found is stealing the parameters used by the factory in the ProxyAgent:
The problem is I don't see any legal way to scrape the
connect
function from the ProxyAgent.Beta Was this translation helpful? Give feedback.
All reactions