cURL / Mailing Lists / curl-library / Single Mail

curl-library

How to set curl to use the same proxy setting as Internet Explorer?

From: Liu Wei <tactoth_at_gmail.com>
Date: Sat, 31 Mar 2012 18:32:44 +0800

Hi together,

I'm trying to make curl use the same proxy setting as Internet Explorer.
I used the following code:

         WINHTTP_CURRENT_USER_IE_PROXY_CONFIG config;
         WinHttpGetIEProxyConfigForCurrentUser( &config);
         curl_easy_setopt(curl, CURLOPT_PROXY,
translateProxyString(config.lpszProxy).c_str());

This piece of code works well when no authentication is required for the
proxy. However when authentication is on, Internet Explorer pops out a
dialog for me to input password, then it proceeds to download the page,
post requests, etc. But my app stopped stops being able to connect.

Anybody knows how to solve this? Can anybody give me some sample code,
or a link? cuz I think it's quite common a problem everyone uses curl
encounters.

Best regards
Tactoth
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-03-31