I have a function which is an extended version of SimplePies Simplepie_File class which accesses web based content either through CURL or fsockopen.
I am trying to update it so that it can use a proxy to access the content and the fsockopen branch works fine but whenever I try to access any page through a proxy with CURL I get the following error
error 56: Proxy CONNECT aborted
If I try a very simple CURL function like the following I get the same issue
Code:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://www.mysite.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if(!empty($proxy)){
curl_setopt($ch, CURLOPT_PROXY, "xx.xx.xx.xx:8080");
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
}
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_USERAGENT, "some user agent");
$result['CONTENT'] = curl_exec($ch);
$result['INFO'] = curl_getinfo($ch);
$result['ERROR'] = curl_error($ch);
curl_close($ch);
print_r($result);
I get the following in the result
Array ( [CONTENT] => [INFO] => Array ( [url] => http://www.darkpolitricks.com [content_type] => [http_code] => 0 [header_size] => 0 [request_size] => 123 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.734 [namelookup_time] => 0 [connect_time] => 0.375 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => -1 [upload_content_length] => -1 [starttransfer_time] => 0 [redirect_time] => 0 ) [ERROR] => Proxy CONNECT aborted )
Without using a proxy I can access any web content perfectly well so its only an issue with Proxies AND CURL as if I use file_get_contents or fsockopen then I can go through proxies no problem.
I have not found much help on Google and am pretty new to PHP. I have checked all the .ini settings, extensions and settings but cannot see anything I should enable.
I am running this on my windows XP laptop through WAMPSERVER on my localhost.
Any help would be much appreciated
Thanks