|
Validating Incoming Clients for Anonymous Proxy Use
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:
<?php
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:
<?php
$URL = "www.mperium.com";
$Ports = array(80, 3128, 1080, 8080);
$bOpenProxy = false;
$Timeout = 5;
?>
| Comments: | ||
| RE: Limitations and Suggestions | Thomas | 10/10/03 00:59 |
| RE: dynamically assigned IPs | Gaddo | 02/19/03 10:53 |
| dynamically assigned IPs | noel darlow | 02/10/03 22:02 |
| RE: Port 80 & little mistake | Gaddo Benedetti | 02/04/03 07:51 |
| Port 80 & little mistake | gosciu | 01/17/03 16:02 |
| Limitations and Suggestions | Lee | 12/29/02 02:48 |
|
If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly. | ||


