Sr. Web Developer
mediabistro.com
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume

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;
?>
Next Page

[Page 1]  [Page 2]  


Comments:
RE: Limitations and SuggestionsThomas10/10/03 00:59
RE: dynamically assigned IPsGaddo02/19/03 10:53
dynamically assigned IPsnoel darlow02/10/03 22:02
RE: Port 80 & little mistakeGaddo Benedetti02/04/03 07:51
Port 80 & little mistakegosciu01/17/03 16:02
Limitations and SuggestionsLee 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.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.