Page 1 of 1

Troubleshooting Multi Curl Proxy Support

Posted: Tue Mar 06, 2012 4:20 pm
by calebf
I am trying to get multi curl to work with proxies. My script works fine without a proxy but as soon as I add the typical CURL options for using a proxy it fails to retrieve the pages. I have tried everything, triple checked to make sure my proxies were working, tried a variety of CURL options, etc. Nothing seems to work. Below is how I have it setup now, from what I can understand this configuration should work...

Code: Select all

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXY, $proxies[rand(0,count($proxies))]);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
Any ideas?