Respect `NO_PROXY` environment variable.
With the try_proxy_from_env(true) option, ureq correctly reads the HTTP[S]_PROXY environment variables, but it doesn't honor the NO_PROXY environment variables. Also, it's not possible to efficiently implement from outside of ureq, because you would have to create a new Agent for each request to a different domain, instead of being able to share the same agent state among all domains.
Zicklag @.***> wrote:
> NO_PROXY environment variables. Also, it's not possible to
> efficiently implement from outside of ureq, because you would have to
> create a new Agent for each request to a different domain, instead of
> being able to share the same agent state among all domains.
Also redirects that had different proxy needs wouldn't work.
@zicklag
but it doesn't honor the NO_PROXY environment variables.
I know very little about proxies. PR welcome.
Also, it's not possible to efficiently implement from outside of
ureq, because you would have to create a newAgentfor each request to a different domain, instead of being able to share the same agent state among all domains.
Agent is reusable for multiple requests.
@mcr
Also redirects that had different proxy needs wouldn't work.
Not sure I follow. Do you mean there should be different proxy settings per request host?
Martin Algesten @.***> wrote: >> Also redirects that had different proxy needs wouldn't work.
> Not sure I follow. Do you mean there should be different proxy settings per request host?
The point of NO_PROXY is that it does not use the proxy for certain hosts. So, in effect, yes, there are different proxy settings (namely: none) for some hosts.
ureq 3.x needs support for this. We should do all the options curl does:
https://github.com/curl/curl/blob/master/docs/libcurl/opts/CURLOPT_NOPROXY.md