cURL / Mailing Lists / curl-library / Single Mail

curl-library

Problem connecting proxy using libcurl

From: Tan Li San <lisan_at_icg.ncs.com.sg>
Date: Wed, 26 Sep 2001 18:06:02 +0800

Thanks Daniel & Nielsen, the previous problem was resolved after installing
cURL 7.9.

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.

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.
Received on 2001-09-26