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

Add support for the NO_PROXY environment variable #360

Closed
sethmlarson opened this issue Sep 19, 2019 · 11 comments
Closed

Add support for the NO_PROXY environment variable #360

sethmlarson opened this issue Sep 19, 2019 · 11 comments
Labels
proxies Issues related to HTTP and SOCKS proxies requests-compat Issues related to Requests backwards compatibility

Comments

@sethmlarson
Copy link
Contributor

sethmlarson commented Sep 19, 2019

The NO_PROXY environment variable is described here:

In order to accomplish this task we'd need:

  • Implementing NO_PROXY, a list of hosts that will bypass the proxy if found within the list.
  • Only enabled if trust_env=True
  • Documentation updates for the new environment variable.
  • Test cases for all code branches.
@sethmlarson sethmlarson added good first issue Good for newcomers requests-compat Issues related to Requests backwards compatibility labels Sep 19, 2019
@elwinmartin
Copy link

@sethmlarson Hi Seth!

I would love to work on this if I could!

I'm mostly familiar with this library as a user but I think the context provided should be clear enough to adapt this for httpx.

@sethmlarson
Copy link
Contributor Author

That would be awesome!! I'll assign the issue to you :)

If you have questions or doubts feel free to reach out here and we'll try our best to help.

@tomchristie
Copy link
Member

Looks good.
Related to #404. I wonder if cURL would be a good baseline set of environment variables to adhere too? That's probably more robust and mature than any other tooling out there, so I'd be okay with us explicitly following their lead.

@mariaS210
Copy link
Contributor

@sethmlarson hello! is someone working on this? if not, i'd like to try it

@florimondmanca
Copy link
Member

Feel free to go ahead @mariaS210! 🎉

@yeraydiazdiaz
Copy link
Contributor

Closed via #471

@tomchristie
Copy link
Member

Reopening this, since it's evidently been closed in error - #471 adds NO_PROXY handling utility functions, but doesn't tie it in to the client.

@pawamoy
Copy link

pawamoy commented Jan 20, 2020

Is there another way to bypass the proxies while waiting for NO_PROXY to be tied into the client?

@tomchristie
Copy link
Member

You can use trust_env=False to disable system proxies.

https://www.python-httpx.org/environment_variables/

@evanlurvey
Copy link
Contributor

I have addressed this in #835

@evanlurvey
Copy link
Contributor

@florimondmanca Would you want to close this issue now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proxies Issues related to HTTP and SOCKS proxies requests-compat Issues related to Requests backwards compatibility
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants