Is it okay to install undici in Node and use EnvHttpProxyAgent and setGlobalDispatcher? #3557
Answered
by
mcollina
bruce-c-liu
asked this question in
Q&A
-
Hi, I'm trying to use native Node fetch, but I need to set a global proxy dispatcher that respects HTTPS_PROXY env variable. So I tried directly installing import { EnvHttpProxyAgent, setGlobalDispatcher } from "undici";
setGlobalDispatcher(new EnvHttpProxyAgent());
fetch(<some url>); // <== notice I'm using Node's native fetch. This seems to work! My question is are there any issues with this approach? |
Beta Was this translation helpful? Give feedback.
Answered by
mcollina
Sep 6, 2024
Replies: 1 comment 1 reply
-
None, that's the way it's done. If there are issues, we'd consider those as bugs. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mcollina
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
None, that's the way it's done. If there are issues, we'd consider those as bugs.