-
Notifications
You must be signed in to change notification settings - Fork 318
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
http_proxy and https_proxy (and probably no_proxy) not supported out of the box #356
Comments
While convenient, perhaps it's better to be explicit about this. See for example https://httpoxy.org. |
It seems that this could be mitigated by the web server though, as most ruby deployments don't run as CGI (?). Still, this an available convenience from ruby standard library. |
…proxy support out-of-the-box); makes working in intranets much easier, although I have to convert every Addressable::URI into a ruby URI (Closes httprb#356)
@britishtea see http://ruby-doc.org/stdlib-2.3.1/libdoc/uri/rdoc/URI/Generic.html#method-i-find_proxy it's already solved for ruby. |
I would like to add some context here. Being able to set proxy based on environmental variables like the examples above, is critical when using code inside intranets or "big corps". There are many ways in which connecting to the outside world can be restricted in those environments and a proxy is a way to let whitelisted applications access the external world. While I understand that a proxy can be a choice of the programmer when explicitly called by the chainable These three env variables are a default on Linux, and when set, are usually defined in /etc/environments, so its available system-wide, or on a per-application basis. |
@brodock we're aware of the concept of egress proxies and the associated utility of this feature 😉 If you'd like to move this forward, I'd suggest opening a PR. It seems @HoneyryderChuck had this partially implemented at one point? HoneyryderChuck@4eeacc1 URI#find_proxy appears to do the heavy lifting already. |
I don't know if this was by design, but it took me some figuring out on how to explicitly set proxy.
However, for portability, I'd automatically set proxy from the environment (the
http{,s}_proxy
env var), just likenet/http
does.It's not that hard, as URI#find_proxy is all you need to accomplish this. This also has the benefit of supporting the
no_proxy
env var.The text was updated successfully, but these errors were encountered: