1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

My http proxy checker script

Discussion in 'Proxies' started by tutzor, Aug 24, 2009.

  1. tutzor

    tutzor Registered Member

    Joined:
    Aug 13, 2008
    Messages:
    76
    Likes Received:
    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 ($chCURLOPT_URL"http://www.blogherald.com/");
        
    curl_setopt($chCURLOPT_HEADER1); //show headers
        
    curl_setopt($chCURLOPT_HTTPGET,1);
        
    curl_setopt($chCURLOPT_RETURNTRANSFER1); 
        
    curl_setopt($chCURLOPT_FOLLOWLOCATION1);
        
    curl_setopt($chCURLOPT_HEADERFALSE); 
        
    curl_setopt($chCURLOPT_VERBOSETRUE);
        
    curl_setopt($chCURLOPT_CONNECTTIMEOUT3);
        
    curl_setopt($chCURLOPT_TIMEOUT3);
        
    curl_setopt($chCURLOPT_PROXYtrim($proxies[$p])); 
        
        
    $data curl_exec($ch);

        if (
    preg_match("!Herald!"$data)){
            echo 
    "<font color=\"blue\"><b>".$proxies[$p] ." - Success! " "Total time: ".curl_getinfo($chCURLINFO_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);
    }
    ?> 
     
    • Thanks Thanks x 2
  2. proloy

    proloy Newbie

    Joined:
    Jul 9, 2009
    Messages:
    3
    Likes Received:
    0
    Fatal error: Call to undefined function curl_init() on line 32
     
  3. w84it

    w84it Regular Member

    Joined:
    Jun 18, 2009
    Messages:
    442
    Likes Received:
    752
    That means you don't have curl installed on your server.
     
  4. tutzor

    tutzor Registered Member

    Joined:
    Aug 13, 2008
    Messages:
    76
    Likes Received:
    9
    Yep, you need to have curl enabled. If you have access to php.ini uncomment this line - extension=php_curl.dll