Skip to content

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

Merged
seanmonstar merged 3 commits into
seanmonstar:masterfrom
thomastaylor312:feat/no_proxy
Jun 8, 2020
Merged

seanmonstar merged 3 commits into
seanmonstar:masterfrom
thomastaylor312:feat/no_proxy

Conversation

@thomastaylor312

Copy link
Copy Markdown
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
Copy Markdown
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

thomastaylor312 commented Apr 10, 2020 •

Copy link
Copy Markdown
Contributor Author

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

abrown commented Apr 21, 2020

Copy link
Copy Markdown

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

@kjedamzik

Copy link
Copy Markdown

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

@seanmonstar seanmonstar left a comment

Copy link
Copy Markdown
Owner

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
Copy Markdown
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