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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Contribution to fix multiple issues with proxy support #4318
Comments
The patch (includes fix for multiple of the above (except
To apply this patch, download and install Fixes:
|
@mbargiel would you like to create a Pull Request? |
@mbargiel please can you put this in a pull request and tag me? If you cant I will |
@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 |
OK so I went further and implemented an HTTP CONNECT fix since we needed it for our own project. I revisited and simplified patch at the expense of introducing a dependency (which has a small footprint - https://www.npmjs.com/package/proxy-from-env). I would like to know if the |
To summarize, here's what I would like to contribute, potentially all as separate PRs:
|
Sorry @jasonsaayman my brain hadn't connected together the facts that you asked for a PR and you were the maintainer 馃槅 I'll get on it for all 3 items in the short list above. It will be easier to discuss the specifics of each in their own PR. |
The 3rd PR is dependent on the first two (well, mostly the "Resolving proxy from env on redirect" one) so I would suggest looking at those first before I open the last PR. |
Ok cool great thanks, I will look at this tonight |
Thank you! This is amazing |
I have not forgotten this, i will get to it asap as i am going through all the open pull requests to finish cutting a v1 |
This has been merged 馃コ |
@jasonsaayman Actually, there's still one last thing to fix for me to consider this complete 馃槄 In my Axios fork, I integrated So I'm not enclined to contribute the https-proxy-agent-based version of my fork, unless you don't mind adding that, then (possibly) switching to hpagent later. At the very least I could open a Draft PR so you can see what it's about and see why I hadn't done so yet. |
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 usingpatch-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:
setProxy
, which is a problem when the proxy protocol and upstream protocol don't match)Other changes that I made in my patch:
http_proxy
,https_proxy
andno_proxy
(when not passing an explicitproxy
config option) when following redirects (http_proxy
andhttps_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
Additional context/Screenshots
N/A
The text was updated successfully, but these errors were encountered: