Jump to content

checking for proxy.


seany123

Recommended Posts

i dont want to allow people on my site if they are trying to enter via a proxy...

 

i have looked around and found a couple solutions.

 

1.

$proxy_headers = array(   
'HTTP_VIA',   
'HTTP_X_FORWARDED_FOR',   
'HTTP_FORWARDED_FOR',   
'HTTP_X_FORWARDED',   
'HTTP_FORWARDED',   
'HTTP_CLIENT_IP',   
'HTTP_FORWARDED_FOR_IP',   
'VIA',   
'X_FORWARDED_FOR',   
'FORWARDED_FOR',   
'X_FORWARDED',   
'FORWARDED',   
'CLIENT_IP',   
'FORWARDED_FOR_IP',   
'HTTP_PROXY_CONNECTION'   
        );
foreach($proxy_headers as $x){
if (isset($_SERVER[$x])) die("You are using a proxy!");
}

 

2.

$ports = array(8080,80,81,1080,6588,8000,3128,553,554,4480);
foreach($ports as $port) {
    if (@fsockopen($_SERVER['REMOTE_ADDR'], $port, $errno, $errstr, 30)) {
        die("You are using a proxy!");
    }
}

 

i know neither are sure ways to beat proxies but apparently they work...

 

my problem is i have tried both on my site and whenever i try access my site via proxy or not my site just loads.... and loads and loads and nothing else happens?

 

 

so does anyone have any fix to this? or a better way to detect proxies?

 

all help would be great.

Link to comment
Share on other sites

and finally after a long wait i got this message:

 

Gateway Time-out

 

The gateway did not receive a timely response from the upstream server or application.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.