PHPBuilder - Validating Incoming Clients for Anonymous Proxy Us Page 2



RSS Twitter
Articles Application Architecture

Validating Incoming Clients for Anonymous Proxy Us - Page 2

by: Gaddo F. Benedetti
|
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:

<?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(80312810808080);
    
$bOpenProxy false;
    
$Timeout 5;
?>

« Previous Page
1
|
2
|
3
|
4
Next Page »

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Gaddo F. Benedetti

Comment:



Comment:

(Maximum characters: 1200). You have characters left.