Created
August 14, 2012 15:14
-
-
Save iloris/3350190 to your computer and use it in GitHub Desktop.
Proxy detection php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( | |
$_SERVER['HTTP_X_FORWARDED_FOR'] | |
|| $_SERVER['HTTP_X_FORWARDED'] | |
|| $_SERVER['HTTP_FORWARDED_FOR'] | |
|| $_SERVER['HTTP_CLIENT_IP'] | |
|| $_SERVER['HTTP_VIA'] | |
|| in_array($_SERVER['REMOTE_PORT'], array(8080,80,6588,8000,3128,553,554)) | |
|| @fsockopen($_SERVER['REMOTE_ADDR'], 80, $errno, $errstr, 30)) | |
{ | |
exit('Proxy detected'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment