Validating proxy via PHP

Validating proxy via PHP

This is how we use and curl to validate any proxy simply you pass the url with IP and port number and results will be printed immediately.

In PHP we have to request a given URL via the proxy and see if it will respond with the expected result.
First on box debian based you need to run the following command to instal php-curl:

sudo apt-get install php5-curl


Curl request code:


/* PHP script written by W. Al Maawali  
# (c) 2014 Founder of Eagle Eye Digital Solutions
# script starts here:*/

//pass IP and Port via URL
$passByIPPort= $_GET["ip"] . ":" . $_GET["port"];

// You can use any web site here to show you real ip such as
$url = "";

// Get current time to check proxy speed
$loadingtime = time();

$theHeader = curl_init($url);
curl_setopt($theHeader, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($theHeader, CURLOPT_TIMEOUT, 20);
curl_setopt($theHeader, CURLOPT_PROXY, $passByIPPort); 

//Execute the request
$curlResponse = curl_exec($theHeader);

if ($curlResponse === false) 
    echo "Proxy is not working: ", curl_error($theHeader);
    //print the output
	echo $curlResponse;
	// Get Proxy speed speed
	echo "Proxy speed: " . (time() - $loadingtime) . "s<br />\n";
}// end if






On the other node we will wait for the proxy request to be received and executed the code is small.


Display ip on a different node code:



echo  "Proxy is up and working :).<br />\n" . " The IP address we found from your request is: "  . getenv("REMOTE_ADDR") ."<br />\n" ;


Demo of this code can be seen here:

Those were the easy steps to validate a proxy via php if you are looking for an advance multi proxy validator then we have a free tool try it E-bouncer.



Digiprove sealCopyright protected by Digiprove © 2014 Eagle Eye Digital Solutions
The following two tabs change content below.
Crypto currency , security , coding addicted I am not an expert or a professional I just love & enjoy what I am addicted on๐Ÿค 

Latest posts by Warith Al Maawali (see all)

PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language.
Linux is, in simplest terms, an operating system. It is the software on a computer that enables applications and the computer operator to access the devices on the computer to perform desired functions. The operating system (OS) relays instructions from an application to, for instance, the computer’s processor.


  1. Line 34, there is a problem, “,” should not be there.

    • Dear Shin,

      You can use . or , in echo with php both are fine it would be wrong if I use , in return statement

      echo is a language construct (not a function) and can take multiple arguments, that’s why , works. using comma will be slightly even (but only some nanoseconds, nothing to worry about)

      The above code is tested and runs fine on our nodes.

  2. One of the most simple code outs that have seen; respect!

Pin It on Pinterest