Has anyone of you tried using rotating proxies? How easy is this to implement? Does it work well? Your experience please
PS: i see questions like \"how to make php s
PHP Curl supports a lot of proxy commands.
CURLOPT_PROXYAUTH
CURLOPT_PROXYPORT
CURLOPT_PROXYTYPE
CURLOPT_PROXY
CURLOPT_PROXY_SERVICE_NAME
CURLOPT_PROXYUSERPWD
CURLOPT_PROXYHEADER
CURLOPT_HTTPPROXYTUNNEL
See for more information: http://php.net/manual/en/function.curl-setopt.php
Simple example below.
$proxy = array();
$proxy[] = '1.2.3.4';
$proxy[] = '5.6.7.8';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_PROXY, $proxy[array_rand($proxy)]);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
$result = curl_exec($ch);
curl_close($ch);