curl-library
proxy not working on Windows
Date: Thu, 8 Oct 2009 20:08:32 -0700
Hi,
I'm trying to get my program to work through a proxy. My code is simple:
CURL* handle = curl_easy_init();
CURLcode res;
res = curl_easy_setopt( handle, CURLOPT_VERBOSE, true );
res = curl_easy_setopt( handle, CURLOPT_PROXY, "liberty:3128" );
res = curl_easy_setopt( handle, CURLOPT_URL, "..." );
CURLcode curlStatus;
curlStatus = curl_easy_perform( handle );
I have a proxy server (squid) running on liberty on port 3128 that
allows all HTTP access. I checked it from Firefox and it does work as
expected.
However, my program returns CURLE_COULDNT_RESOLVE_HOST - always: when
I configure the proxy server to allow all connections and when I
configure it to deny all connections.
On Linux it is working just fine, but I just don't know what is
happening on Windows. I'm linking to libcurl statically, and I'm in a
time crunch: it looks like a real hassle to download the source code,
compile it debuggable on Visual Studio and see what the heck is
happening inside. I guess if I don't get any answers I'll have to do
that.
Did anyone get this problem? Any advice?
Thanks,
Tiberiu
PS One quirky thing that I've noticed with CURLOPT_PROXY is that you
have got to pass it a char*, and not a const char*, otherwise it
simply doesn't work.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-10-09