cURL / Mailing Lists / curl-library / Single Mail

curl-library

Automatic use of http_proxy environment variable

From: <andrei_at_korostelev.net>
Date: Tue, 16 Sep 2014 14:35:33 +0200

libcurl makes use of http_proxy, https_proxy etc environment variables to
setup proxy connections.
Being a useful feature in 95% of cases it makes the life of may our users
difficult for the rest 5%.

We have an app which we distribute to Windows and Linux and which makes
use of libcurl.
The app allows to setup proxy in config file. However when http_proxy env.
variable is set it comes into a conflict with app-specific proxy settings.
This is especially annoying for Windows users.

The solution I propose is very simple. Since all proxy-detection magic
lives in detect_proxy() function in url.c, we can easily
call this function conditionally:

#ifdef CURL_ENABLE_PROXY_DETECTION
 proxy = detect_proxy(conn);
#endif

CURL_ENABLE_PROXY_DETECTION should be set during configuration of libcurl
(./configure)
defaulting to true to preserve current behavior.

Regards,
Andrei

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-09-16