hi,

this is my program to retieve contents of a web page while connecting 
through an http proxy server.while i request for a webpage i get the 
follwoing error 
from proxy server 

"Error Code: 407 Proxy Authentication Required. The ISA Server requires 
authorization to fulfill the request. Access to the Web Proxy service is 
denied. (12209)"

int main(int argc, char* argv[])
{
  if (argc > 1)
  {
    string url(argv[1]);

    cout << "Retrieving " << url << endl;

    // Our curl objects
    CURL *curl;
    CURLcode result;

    // Create our curl handle
    curl = curl_easy_init();

    if (curl)
    {
      // Now set up all of the curl options
      curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorBuffer);
      curl_easy_setopt(curl, CURLOPT_URL, argv[1]);

      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
      curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writer);
      curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer);

      curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
      curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);

      curl_easy_setopt(curl, CURLOPT_PROXY, "http://172.17.31.163";);
      curl_easy_setopt(curl, CURLOPT_PROXYPORT, 8003);

      curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, "test:test");


      // Attempt to retrieve the remote page
      result = curl_easy_perform(curl);

      // Always cleanup
      curl_easy_cleanup(curl);


}
 // Did we succeed?
      if (result == CURLE_OK)
      {
        cout << buffer << "\n";
        exit(0);
      }
      else
      {
        cout << "Error: [" << result << "] - " << errorBuffer;
        exit(-1);
      }
    }
  }
}
the result is taken in a callback function write callback,here the above 
proxy error page data is shown which i specified above.
The things works fine if i donot use a proxy server...I use libcurl 
version 7.16.3 .please help me out in this...





______________________________________________________________________
_______________________________________________
cURLpp mailing list
[email protected]
http://www.rrette.com/mailman/listinfo/curlpp

Reply via email to