cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_easy_setopt for SSL proxy

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 26 Jan 2009 00:30:24 +0100 (CET)

On Mon, 26 Jan 2009, nir droid wrote:

> curl_easy_setopt(CURLOPT_PROXY, "http://1.2.3.4:80")<https://sslproxy.com:8443/>
> curl_easy_setopt(CURLOPT_PROXY,
> "https://1.2.3.4:8443")<https://sslproxy.com:8443/>
>
> doesn't #2 runs over #1?
>
> there are many http urls that redirect to htts page (usually login page), so
> if you use proxy, you need both http and https proxy

No I don't "prefer" that way either since it doesn't work.

You clearly didn't read my explanation of how this works, or Craig West's
explanation of what he'd like to do and I would agree that it seems like a
good thing to provide.

In current and past libcurl versions however you specify the proxy to use and
then the URL that will go over that specified proxy - basically whatever the
protocol is. (There's an additional complexity added by the fact that libcurl
also supports the "standard" environment variables but I'll ignore that for
now).

If you need to do more advanced stuff for redirects that what libcurl
supports, the fix is generally to not use libcurl's automatic following but
instead do it yourself. By using CURLINFO_REDIRECT_URL, that's not even hard
or a lot of work.

-- 
  / daniel.haxx.se
Received on 2009-01-26