curl-library
Re: Automatic use of http_proxy environment variable
Date: Wed, 17 Sep 2014 09:53:08 +0400
Hello Andrei,
>> 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.
akn> Right but I'm pretty sure the most Windows developers will expect that
akn> plain curl_easy_perform() call is a way to do this.
akn> In other words, if they do not need proxy, they just don't configure it.
You are not quite right here.
Mostly, developers expect that if they do not configure some options,
the library will use some reasonable default. For proxy, if the
developer's code doesn't set it, the reasonable default is "use
my magic detection", and it is the right thing.
It allows lots of already existing code to work via proxies without
modifying the application.
>>> Technically it will probably achieve a right result (proxy will be
>>> disabled) but it looks unnecessary over-complicated.
>>> Don't you think so?
You want to disable detection magic - you do it specifically in your
code by setting proxy to an empty string. It is logical and
straightforward, and it is well documented both in the tutorial and in
man page for CURLOPT_PROXY option.
>> 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 "*".
>>
akn> If we set the default behavior to detect proxy on Unix and not to detect
akn> it on Windows, there will be no need to explicitly set this option in most
akn> cases.
No, no, never do that! It will make applications that use libcurl
behave differently on Windows and Unix.
-- Best regards, Tetetest mailto:tetetest_at_rambler.ru ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.htmlReceived on 2014-09-17