1 Feb 05:31
Invalid proxy settings
Chandrakant Bagul -ERS, HCL Tech <Chandrakant.Bagul <at> hcl.com>
2012-02-01 04:31:30 GMT
2012-02-01 04:31:30 GMT
Hi All,
I have proxy server(Squid) with IP address of 192.168.1.12.
In my curl code I use following code to set proxy settings:
curl_easy_setopt(pCurl, CURLOPT_PROXY, proxyAddress);
curl_easy_setopt(pCurl, CURLOPT_PROXYPORT, port);
& check response code after execution using
curl_easy_getinfo(pCurl, CURLINFO_RESPONSE_CODE, &respCode); //If respCode
is 200 means Internet connectivity available
I have 3 cases to test this setup
1. Incorrect proxy server address:
If I provide proxy server address as "192.168.1.45" or "http://wrong.proxyserver.com", then
Response code is 0, means internet connection is not available.
2. Correct Proxy server address
If I provide proxy server address as "192.168.1.12", then
Response code is 200, means internet connection is available.
3. Invalid proxy server address
If I provide proxy server address as "/192.168.1.45" or "/./././", then
Response code is 200, means internet connection is available. But
here proxy is invalid, but still respCode return as 200.
This is buggy situation.
Please let me know how to resolve this issue(by doing some extra checks or
something).
Thanks & regards,
Chandrakant
::DISCLAIMER::
(Continue reading)
RSS Feed