-
Notifications
You must be signed in to change notification settings - Fork 130
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
Support HTTP_PROXY and NO_PROXY environment variables #1168
Comments
Ref. nodejs/undici#1650 |
Thanks for acknowledging the feature request. In the meantime is it possible to bypass the dynamic install done using jsdelivr and rely only on node_modules ? Some corporate environments provide vetted mirrors of npm and disallow the use of proxys in build environments. |
The next release will integrate this feature that was just merged this week #1156 |
Also, even if you use It should be possible for us to add a proxy config option, and then respect that option when fetching from jsDelivr. I’m looking into it now. The main difficulty is the plumbing (we make the request within |
You could try installing Undici and adding the following to your import {ProxyAgent, setGlobalDispatcher} from "undici";
const proxyAgent = new ProxyAgent({uri: process.env.https_proxy});
setGlobalDispatcher(proxyAgent); Or, if your proxy has a username and password and uses basic auth: import {ProxyAgent, setGlobalDispatcher} from "undici";
const proxyUrl = new URL(process.env.https_proxy);
const token = `Basic ${btoa(`${proxyUrl.username}:${proxyUrl.password}`)}`;
const proxyAgent = new ProxyAgent({uri: proxyUrl.protocol + proxyUrl.host, token});
setGlobalDispatcher(proxyAgent); This would require you to set the |
Install undici and adding the content of upper code block to |
Thanks, the provided code fixed it for me too. I’ll try the implicit import route too once released. |
This worked for me after some changes. In my case, there is not only a corporate proxy but also a custom CA. For now I just disabled the check, but ideally I should somehow configure it to use my custom CA certificate: import {ProxyAgent, setGlobalDispatcher} from "undici";
const proxyAgent = new ProxyAgent( {uri: process.env.https_proxy,
requestTls:{rejectUnauthorized:false}} );
setGlobalDispatcher(proxyAgent); |
in case of ZScaler or any other thing like that the |
Hi,
building the example pages fails behind a corporate proxy.
Fetching d3-dsv fails and running npm add d3-dsv does not fix.
I cannot post the stack trace (corporate policies) but it looks like fetch uses undici which does not handle https_proxy and no_proxy env variables.
Thanks
The text was updated successfully, but these errors were encountered: