cURL / Mailing Lists / curl-library / Single Mail

curl-library

Proxy authentication with CONNECT_ONLY option.

From: Praks <praks_123_at_fastmail.fm>
Date: Tue, 04 Jul 2006 09:58:35 +0300

Hi,
    
    I am trying to develop a sample HTTP client application on Cygwin using curl-7.15.3.

    I have used CONNECT_ONLY option in curl and i m trying to fetch a page via proxy with authentication. It doesn't seem to work. On analyzing, using a packet sniffer i found that the proxy authentication credentials are not supplied.

Below is the sample code.
//////////
        curl_easy_setopt(curl, CURLOPT_URL, url);
        curl_easy_setopt(curl,CURLOPT_WRITEDATA,up);
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
        curl_easy_setopt(curl,CURLOPT_HEADERDATA,up);
        curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, hdr_data);
        curl_easy_setopt(curl, CURLOPT_USERAGENT, "SMP/1.0");
        curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1);
         
        curl_easy_setopt(curl, CURLOPT_PROXY , <proxy ip address>);
        curl_easy_setopt(curl, CURLPROXY_HTTP , 1);
        curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, "test:test123");
        
        res = curl_easy_perform(curl);
/////////////
1. If i use CONNECT_ONLY option with proxy, but without authentication, it goes through.
2. If i do not use CONNECT_ONLY, then i am able to successfully complete GET, POST via proxy with authentication.

I am really stuck and this thing is freaking me out :-)

Any help is appreciated.

Thanks in Advance...

-Prakash

-- 
  Praks
  praks_123_at_fastmail.fm
-- 
http://www.fastmail.fm - Does exactly what it says on the tin
Received on 2006-07-04