Support for automatically detecting system proxy settings
Hello Louis,
Opening this issue as requested by you on Discord.
On Unix-like systems, variables like all_proxy, http_proxy, https_proxy, no_proxy are often automatically detected by tools (e.g. curl). This is more of a convention than a standard, nevertheless it's very common.
Some additional info: https://superuser.com/questions/944958/are-http-proxy-https-proxy-and-no-proxy-environment-variables-standard
This would enable httpc to be used from behind a proxy (which is sometimes enforced, e.g. company networks). Additionally, it would be useful to be able to override the proxy in code on a per request basis.
Thanks, David
Sounds very useful, thank you for the link also. What is it that HTTP clients must do in the presence of these variables?
If it helps any, I believe this is a case where a client has a "non-transparent" proxy, rather than a transparent/inline proxy.
This means that you have to send your webtraffic to somewhere other than your default route which traffic would typically flow (and if the proxy is inline, you wouldn't need to configure anything, as it would be on the path of your default route).
Some enterprises use a non-transparent proxy which requires explicit configuration, saying "send all my traffic to this server over this port".
I believe httpc would need to expose the set_options from httpc for proxy:
https://www.erlang.org/doc/apps/inets/httpc.html#set_options/2
{proxy, {Proxy, NoProxy}} | {https_proxy, {Proxy, NoProxy}}
Proxy :: {HostName, Port}
or if not exposing them, using the denoted var conventions.
I believe this should do it, if that helps explain the problem any :)!