-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
aiohttp not honoring no_proxy
#4431
Comments
The pull request is welcome! |
Could you point me in the right direction? I'm guessing this is where I'll need to check the no proxy list https://github.com/aio-libs/aiohttp/blob/master/aiohttp/client.py#L424 and blank the proxy if found? |
Hmm, interesting. It doesn't parse itself but reuses |
No. That is why I suggesting doing it manually. I could only find a reference to I could add a |
Maybe a solution like 5d92cb5 might work. Would still have to write the tests. I should probably read up on the no_proxy list standards to make sure hostnames put in the no_proxy list are matching correctly. |
Actually I looks like urllib has code to handle no_proxy. I'll use the appropriate function from there. |
Any ETA for this? We're suffering from the same problem with aiohttp not honoring no_proxy vars. |
Even I am interested in this fix as a third party application we are using is dependent on this library. |
We tested these changes and they worked for us! |
Glad I found this bug report! Just wondering if there are any workarounds until this patch gets accepted? I need to use a proxy to get to external services but that proxy has no access to other internal services, hence my need for no_proxy. At the moment the only option I seem to have is to create separate sessions with and without proxies set, but that means my app would need to be aware of the network setup of where it gets installed, which is certainly not ideal. Unless there are other options I am missing? |
PR aio-libs#4445 by @scirelli. Fixes aio-libs#4431. Co-authored-by: Steve Cirelli <[email protected]> Co-authored-by: Sviatoslav Sydorenko <[email protected]> (cherry picked from commit 1a4126a)
PR aio-libs#4445 by @scirelli. Fixes aio-libs#4431. Co-authored-by: Steve Cirelli <[email protected]> Co-authored-by: Sviatoslav Sydorenko <[email protected]> (cherry picked from commit 1a4126a)
…5556) PR #4445 by @scirelli. Fixes #4431. Co-authored-by: Steve Cirelli <[email protected]> Co-authored-by: Sviatoslav Sydorenko <[email protected]> (cherry picked from commit 1a4126a)
PR aio-libs#4445 by @scirelli. Fixes aio-libs#4431. Co-authored-by: Steve Cirelli <[email protected]> Co-authored-by: Sviatoslav Sydorenko <[email protected]>
PR aio-libs#4445 by @scirelli. Fixes aio-libs#4431. Co-authored-by: Steve Cirelli <[email protected]> Co-authored-by: Sviatoslav Sydorenko <[email protected]>
#7235) <!-- Thank you for your contribution! --> ## What do these changes do? * Update proxy support docs to honor `no_proxy` env * Complete `trust_env` parameter description to honor `wss_proxy`, `ws_proxy` or `no_proxy` env ## Are there changes in behavior for the user? No ## Related issue number Update docs for: #4431 ## Checklist - [ ] I think the code is well written - [ ] Unit tests for the changes exist - [x] Documentation reflects the changes - [ ] If you provide code modification, please add yourself to `CONTRIBUTORS.txt` * The format is <Name> <Surname>. * Please keep alphabetical order, the file is sorted by names. - [ ] Add a new news fragment into the `CHANGES` folder * name it `<issue_id>.<type>` for example (588.bugfix) * if you don't have an `issue_id` change it to the pr id after creating the pr * ensure type is one of the following: * `.feature`: Signifying a new feature. * `.bugfix`: Signifying a bug fix. * `.doc`: Signifying a documentation improvement. * `.removal`: Signifying a deprecation or removal of public API. * `.misc`: A ticket has been closed, but it is not of interest to users. * Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files." --------- Co-authored-by: Marcel Loop <[email protected]> Co-authored-by: Sam Bull <[email protected]>
aio-libs#7235) <!-- Thank you for your contribution! --> * Update proxy support docs to honor `no_proxy` env * Complete `trust_env` parameter description to honor `wss_proxy`, `ws_proxy` or `no_proxy` env No Update docs for: aio-libs#4431 - [ ] I think the code is well written - [ ] Unit tests for the changes exist - [x] Documentation reflects the changes - [ ] If you provide code modification, please add yourself to `CONTRIBUTORS.txt` * The format is <Name> <Surname>. * Please keep alphabetical order, the file is sorted by names. - [ ] Add a new news fragment into the `CHANGES` folder * name it `<issue_id>.<type>` for example (588.bugfix) * if you don't have an `issue_id` change it to the pr id after creating the pr * ensure type is one of the following: * `.feature`: Signifying a new feature. * `.bugfix`: Signifying a bug fix. * `.doc`: Signifying a documentation improvement. * `.removal`: Signifying a deprecation or removal of public API. * `.misc`: A ticket has been closed, but it is not of interest to users. * Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files." --------- Co-authored-by: Marcel Loop <[email protected]> Co-authored-by: Sam Bull <[email protected]> (cherry picked from commit 1c49738)
…235 (#7256) **This is a backport of the PR #7235 as merged into master ( 1c49738 ) ## What do these changes do? * Update proxy support docs to honor `no_proxy` env * Complete `trust_env` parameter description to honor `wss_proxy`, `ws_proxy` or `no_proxy` env ## Are there changes in behavior for the user? No ## Related issue number Update docs for: #4431 ## Checklist - [ ] I think the code is well written - [ ] Unit tests for the changes exist - [x] Documentation reflects the changes - [ ] If you provide code modification, please add yourself to `CONTRIBUTORS.txt` * The format is <Name> <Surname>. * Please keep alphabetical order, the file is sorted by names. - [ ] Add a new news fragment into the `CHANGES` folder * name it `<issue_id>.<type>` for example (588.bugfix) * if you don't have an `issue_id` change it to the pr id after creating the pr * ensure type is one of the following: * `.feature`: Signifying a new feature. * `.bugfix`: Signifying a bug fix. * `.doc`: Signifying a documentation improvement. * `.removal`: Signifying a deprecation or removal of public API. * `.misc`: A ticket has been closed, but it is not of interest to users. * Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."
Long story short
aiohttp not honoring
no_proxy
environment variable whentrust_env
is set.Expected behaviour
When there is a
no_proxy
NO_PROXY
environment variable set, URLs listed in that variable should not usehttp{s}_proxy
Actual behaviour
When
trust_env
is set and there arehttp_proxy
andno_proxy
set, the proxy is always used.Steps to reproduce
Set
http{s}_proxy
andno_proxy
, make a request to a domain listed inno_proxy
. The request will still go through the proxy.Your environment
Linux
aiohttp 3.6.2
Company proxy server
The text was updated successfully, but these errors were encountered: