cURL / Mailing Lists / curl-library / Single Mail


Automatic use of http_proxy environment variable

From: <>
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:

 proxy = detect_proxy(conn);

CURL_ENABLE_PROXY_DETECTION should be set during configuration of libcurl
defaulting to true to preserve current behavior.


List admin:
Received on 2014-09-16