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

feat(proxy): Adds NO_PROXY environment variable support #877

Merged
merged 3 commits into from
Jun 8, 2020

Conversation

thomastaylor312
Copy link
Contributor

Adds support for loading from the NO_PROXY or no_proxy environment
variables. This should make reqwest support the system proxy settings.
Please note that I brought in one additional dependency in order to
handle CIDR blocks in the no proxy settings.

Closes #705

@thomastaylor312
Copy link
Contributor Author

The one thing I could use help with here is that if I don't use __internal_proxy_sys_no_cache or run my new tests individually, I get test failures, which is causing some of them to fail. I figure this is due to it caching what it loads from the environment, so I am not sure what the right way is to do it

@thomastaylor312
Copy link
Contributor Author

thomastaylor312 commented Apr 10, 2020

Just added a commit that manually constructs the proxy each time so as to avoid caching for tests. If that is not desired behavior, let me know what else I can do and I'll change it

@abrown
Copy link

abrown commented Apr 21, 2020

@seanmonstar, I could definitely use this--can you take a look?

@kjedamzik
Copy link

thank you, works like a charm ❤️

Adds support for loading from the `NO_PROXY` or `no_proxy` environment
variables. This should make reqwest support the system proxy settings.
Please note that I brought in one additional dependency in order to
handle CIDR blocks in the no proxy settings.

Closes seanmonstar#705
Copy link
Owner

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, easy to read. Thanks for putting this together (and apologies for sleeping on it)!

@thomastaylor312
Copy link
Contributor Author

No problem! Thanks for the review

@seanmonstar seanmonstar merged commit 6914091 into seanmonstar:master Jun 8, 2020
@thomastaylor312 thomastaylor312 deleted the feat/no_proxy branch June 8, 2020 22:36
Nutomic pushed a commit to Nutomic/reqwest that referenced this pull request Nov 7, 2024
)

* feat(proxy): Adds NO_PROXY environment variable support

Adds support for loading from the `NO_PROXY` or `no_proxy` environment
variables. This should make reqwest support the system proxy settings.
Please note that I brought in one additional dependency in order to
handle CIDR blocks in the no proxy settings.

Closes seanmonstar#705
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

Successfully merging this pull request may close these issues.

Added support for the NO_PROXY environment variable
4 participants