Of our response, should we get one, we actually only require the first line to check if a HTTP 200 response has been returned, telling us that the proxy returned us the requested page. Then, and only then, do we change the value of our retuned value to true, which we will return once we’ve cleaned up any open sockets:
<?php
}
return $bOpenProxy;
}
?>
The greatest limitation to this check, as you’ll have guessed, is timeouts; even at a value of five seconds, checking the above ports could take as long as twenty seconds. Thus it should be used sparingly, such as when a user attempts to log in, and should also not be taken as a definitive test either.
However, this can be a useful additional tool to filter out unwanted visitors to your Web server.