#native_company# #native_desc#

Validating Incoming Clients for Anonymous Proxy Us Page 2

By Gaddo F. Benedetti
on December 19, 2002

First of all we’re going to wrap this all up into a function which accepts a simple parameter of the IP address ($IP) to check as a string and will return a Boolean response, as to whether the IP is an open proxy or not:


function isOpenProxy($IP) {


However, we’re also going to define four variables too: the URL to which we’re looking to connect to via the suspected proxy, our default return value, the socket timeout and which ports to try and connect through.
The last of these, in conjunction with the socket timeout, should be kept to a short list. The most common ports used by proxies are 80, 3128, 1080, 8080; although you could potentially connect via practically any port, but this would be impractical to check as each could require to time out as part of the check. Nonetheless we define our four variables:



$Ports = array(80312810808080);

$bOpenProxy false;

$Timeout 5;