Validating proxy via PHP
Posted by Warith Al Maawali on May 1, 2014 in Blog, Source-Codes | 4 comments

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 /* PHP script written by W. Al Maawali # (c) 2014 Founder of Eagle Eye Digital Solutions # http://www.digi77.com # http://www.om77.net # script starts here:*/ //pass IP and Port via URL $theIP=$_GET["ip"]; $thePort=$_GET["port"]; $passByIPPort= $_GET["ip"] . ":" . $_GET["port"]; // You can use any web site here to show you real ip such as http://whatismyipaddress.com/ $url = "https://www.digi77.com/software/bouncer/data/myipvv-by-web.php"; // 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); } else { //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:
<?php 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:
http://fpnl1.digi77.com/proxychecker.php?ip=124.248.211.170&port=3128
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.



Latest posts by Warith Al Maawali (see all)
- Apple iOS Mail Client leaking highly sensitive information - December 27, 2019
- Validating VPN nodes - November 3, 2019
- Migrating from php 5.6 to 7.3 - November 1, 2019
- Linux Kodachi 8.27 The Secure OS - October 20, 2013
- Migrating from Vbulletin to Burning board - March 27, 2016
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.
One of the most simple code outs that have seen; respect!
Thank you John ๐