-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Description
The [protocol]_PROXY and NO_PROXY environment variables are commonly used to configure proxies in applications. Wget and Emacs are two examples. Python's requests library also respects HTTP_PROXY and HTTPS_PROXY out of the box.
It would be great if we could have a helper method like HTTP::Proxy::Client.use_env that would do the followings
- When used, it would automatically load the appropriate settings from ENV and create the corresponding
HTTP::Proxy::Clientobjects. - It would then monkey-patch the
HTTP::Clientclass in the standard library so that the clients use the appropriate proxies in all requests.
Here's an example implementation I used in my project. I will be happy to submit a PR if you think it's a good idea.
Reactions are currently unavailable