question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Contribution to fix multiple issues with proxy support

See original GitHub issue

Describe the issue

This is not exactly a support question, but your PR bot is extremely aggressive and does not allow submitting a blank report, even one created from the New Issue flow.) On with the issue… 🤞

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch axios@0.24.0 for the project I’m working on.

At first I tried using some of the suggestions here like using https-proxy-agent, but it is severely limited in that it does not normal agent options (I hear it’s a regression, and the lib is more or less abandoned). So I went for a deep-dive and I managed to isolate a certain number of flaws. I fixed them using patch-package but I’m willing to contribute them back and open separate PRs for each of these issues (along with tests), when time permits. Would you welcome this?

Issues I believe my changes can fix:

Other changes that I made in my patch:

  • Enable re-evaluation of http_proxy, https_proxy and no_proxy (when not passing an explicit proxy config option) when following redirects (http_proxy and https_proxy could be configured differently)

The patch is fairly large and would probably be better conveyed as multiple PRs, but I’ll share it below. (We have 160 tests in our project confirming the patch solves a number of issues, but I can’t share them here; I would contribute with axios test coverage instead.)

Example Code

N/A

Expected behavior, if applicable

N/A

Environment

  • Axios Version [0.24.0]
  • Adapter [HTTP]
  • Browser [(N/A)]
  • Browser Version [(N/A)]
  • Node.js Version [12.20.0]
  • OS: [Windows 10, macOS Catalina]
  • Additional Library Versions [follow-redirects@1.14.5]

Additional context/Screenshots

N/A

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:13 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
mbargielcommented, Jan 19, 2022

@Amorites @jasonsaayman I definitely want to contribute this as a PR, when time permits. I was planning on splitting it into 3 actually, since it’s addressing 3 different issues.

I also discovered since then that Axios does not have support for HTTP CONNECT, meaning that when using a proxy with HTTP (unencrypted) to reach out to HTTPS endpoint URLs, the connection is not encrypted end to end, but actually unencrypted between the client and the proxy. If HTTPS is used to connect to the proxy as well, then it only works if the proxy is able to generate an SSL certificate on the fly and play Man-in-the-Middle (ie intercept the connection). In any case, in this modern age, it is not unreasonable to expect proxy clients to implement use HTTP CONNECT when accessing for HTTPS over HTTP(S) proxies and enable end-to-end encryption. Unfortunately, fixing this in Axios is somewhat trickier (with respect to supporting user-provided agents or agent configurations…); I tried creating a patch to use the unsupported tunnel library, but that would be a kind of bandaid, especially considering tunnel has not been active for almost 4 years now.

2reactions
jasonsaaymancommented, Jan 19, 2022

@mbargiel please can you put this in a pull request and tag me? If you cant I will

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common Proxy Problems (And How You Can Fix Them)
1. Too many website IP bans · 2. Proxy provider failing · 3. Proxies not configured for your browser or OS · 4....
Read more >
Configure device proxy and Internet connection settings
Configure the Microsoft Defender for Endpoint proxy and internet settings to enable communication with the cloud service.
Read more >
Configuring Web Proxy Support for Confluence
Configuring an outbound HTTP proxy in Confluence. Proxy support is configured by passing certain system properties to the Java Virtual ...
Read more >
Troubleshooting for RDS Proxy - Amazon Aurora
Learn how to troubleshoot issues with RDS Proxy. ... The IAM authentication failed because of too many competing requests.
Read more >
Forward proxy support - Akamai TechDocs
Disable the Proxy in EAA Client > Options > Advanced. · Click Cancel when prompted to enter the proxy credentials, and click Yes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found