curl-library
Re: Automatic use of http_proxy environment variable
Date: Tue, 16 Sep 2014 15:48:40 +0200 (CEST)
On Tue, 16 Sep 2014, andrei_at_korostelev.net wrote:
> Normally if the app is configured not to use proxy, it simply calls
> curl_easy_perform(); which is clean and logical.
Yes, but that also means "please mr libcurl, use your default proxy
environment variable proxy detection magic".
> With your suggestion we shall first do this prelude:
>
> curl_easy_setopt(curl, CURLOPT_PROXYAUTH, CURLPROXY_HTTP);
> curl_easy_setopt(curl, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
> curl_easy_setopt(cutl, CURLOPT_PROXY, "");
>
> and then call
> curl_easy_perform(curl);
>
> Right?
There's no point in setting PROXYAUTH (twice) if you're not using a proxy. But
yes, if you explicitly want to disable proxies that's how to do it. That'll
force libcurl to not use any proxy environment variable.
> Technically it will probably achieve a right result (proxy will be
> disabled) but it looks unnecessary over-complicated.
> Don't you think so?
You think using (a new option like) CURLOPT_PROXYLOGICDISABLED is less
complicated than setting CURLOPT_PROXY to "" ? How so?
Another option is set CURLOPT_NOPROXY to "*".
-- / daniel.haxx.se ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.htmlReceived on 2014-09-16