cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Problem connecting proxy using libcurl

From: Nielsen Linus (ext) <Linus.Nielsen_at_elema.siemens.se>
Date: Wed, 26 Sep 2001 12:50:38 +0200

> I also encountered problems whenever a http proxy is specified in my
> program. The connection seems to "hang" even though i have specified
> connecttimeout and timeout. The connection will however goes through
> successfully if proxy is omitted.

It could be a name resolution problem. Are you really sure that
the myProxy string is correct?

Have you tried using the IP address instead of the name?

What happens if you set the CURLOPT_VERBOSE flag to 1?

     curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);

> In my program:
>
> curl_global_init(CURL_GLOBAL_ALL);
> curl = curl_easy_init();
> curl_easy_setopt(curl, CURLOPT_URL, myURL);
> curl_easy_setopt(curl, CURLOPT_PROXY, myProxy);
> curl_easy_setopt(curl, CURLOPT_PROXYPORT, 8080);
> curl_easy_setopt(curl, CURLOPT_TIMEOUT, 60);
> curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 30);
> ...
> res = curl_easy_perform(curl);
>
> When I tried using curl from the command line, the connection
> goes through
> successfully.
> curl -x myproxy.com:8080 http://www.myurl.com
>
> Have I missed out any steps in my program? Please advise. Thanks.

It's hard to see anything wrong in these few lines of code. I will need to
see
more to tell.

/Linus
Received on 2001-09-26