My http proxy checker script

tutzor

Registered Member
Joined
Aug 13, 2008
Messages
76
Reaction score
9
This script will take your proxy list, connect to a site and pregmatch a word, in this case the URL is- http://www.blogherald.com/ and the match word is "Herald" (change that to whatever URL you want, just make sure to change pregmatch word as well - any word that can be found on the new URL)

By running this script and getting your successful proxies you will know for sure it will work when you use it with your scripts to create accounts or mass message people or w/e.

It will echo out error/success message and write the successful proxies to a file success.txt.

Put your list of http proxies in the rawproxies.txt

You can also set proxy timeout to lower/higher
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
curl_setopt($ch, CURLOPT_TIMEOUT, 3);

Hope you guys find it useful.

PHP:
<?php
/*
 Proxy Checker by tutzor
 */
error_reporting(E_ALL);

$fileName = "rawproxies.txt"; //your file path to file with proxies
$success = "success.txt"; //where to save successful proxies

//Check file
if(!is_file($fileName)) die ('Proxy file not available');
$proxies = file($fileName); 

for($p=0; $p<count($proxies);$p++) { 

    $ch = curl_init(); //initizlize and set url
	curl_setopt ($ch, CURLOPT_URL, "http://www.blogherald.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, 3);
    curl_setopt($ch, CURLOPT_TIMEOUT, 3);
    curl_setopt($ch, CURLOPT_PROXY, trim($proxies[$p])); 
    
    $data = curl_exec($ch);

	if (preg_match("!Herald!", $data)){
		echo "<font color=\"blue\"><b>".$proxies[$p] ." - Success! " . "Total time: ".curl_getinfo($ch, CURLINFO_TOTAL_TIME)." seconds!</font></b><br />";
			$f=fopen($success, "a+");
			fwrite($f, $proxies[$p]);
			fclose($f);
	}
			elseif (curl_errno($ch)) {
			
				echo $proxies[$p] . " Error: ".curl_error($ch)."<br />";
	}
	else {
				echo "There was no Error connecting to proxy, but its still no good.. (No content from source)<br />";
	}

        curl_close($ch);
		@ob_flush();
		flush();
		
		//unset($ch);
}
?>
 
Fatal error: Call to undefined function curl_init() on line 32
 
Fatal error: Call to undefined function curl_init() on line 32

Yep, you need to have curl enabled. If you have access to php.ini uncomment this line - extension=php_curl.dll
 
Back
Top