Skip to content
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

Proxy environment variables ignored #6321

Open
benbucksch opened this issue Mar 25, 2024 · 1 comment
Open

Proxy environment variables ignored #6321

benbucksch opened this issue Mar 25, 2024 · 1 comment

Comments

@benbucksch
Copy link

benbucksch commented Mar 25, 2024

Describe the bug

Axios uses the HTTP proxy, even when it should not.

To Reproduce

Environment

  1. Ubuntu Linux
  2. Proxy set in mate-network-properties
  3. A fresh terminal has environment variables HTTPS_PROXY, HTTP_PROXY, https_proxy, http_proxy set
  4. The proxy is a most recent squid HTTP proxy

Code snippet

export https_proxy=""
export http_proxy=""
// with proxy, see above
let r = await axios.get("https://www.beonex.com");
console.log("page", r.text());

Expected behavior

  • No proxy is used

Actual result

  • The proxy is used

Axios Version

1.5.1

Adapter Version

No response

Browser

No response

Browser Version

No response

Node.js Version

18.15.0

OS

Ubuntu Linux

Additional Library Versions

No response

Additional context/Screenshots

What works

If you set export no_proxy="*", then axios avoids the proxy and it works.

@justindhillon
Copy link

This is not a problem with axios, this is a problem with node.

Axios relies on node's build in globalAgent for http and https. https_proxy, http_proxy, and no_proxy are all handled by node, not axios.

If you want this to be resolved, you can make an issue at node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants