Hello, everyone.
I've been attempting to make a proper proxy checker to check for HTTP proxies for a while, yet I've been unable to find one that correctly finds working proxies. The bulk of my code is below.
$ch = curl_init(); //initizlize and set url
curl_setopt ($ch, CURLOPT_URL, "http://google.com");
curl_setopt($ch, CURLOPT_HEADER, 1); //show headers
curl_setopt($ch, CURLOPT_HTTPGET,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_FAILONERROR, TRUE);
curl_setopt($ch, CURLOPT_PROXY, trim($proxy));
$data = curl_exec($ch);
The code above does indeed work, but when testing the list on other reputable proxy checkers, the majority of the list fails(95%+). Are there any changes I could make to enhance the number of correct proxies it finds?
Thanks in advance,
Resentful