Jump to content

Proxy Blocking


EchoFool

Recommended Posts

Any one who is using IP's that are known to be used by proxies....which would allow people to have multiple accounts on different IPs.

 

But there must be thousands of IPs that many proxys use thus if there was a way to get a list of the known proxy IPs i could block them from access to my site.

Link to comment
https://forums.phpfreaks.com/topic/137205-proxy-blocking/#findComment-716739
Share on other sites

Well I don't know of any Proxt-IP Lists, but to get started, you could use this function (or similar):

 

<?php
function detectProxy(){
	if($_SERVER['HTTP_X_FORWARDED_FOR']) {
		if($_SERVER['HTTP_CLIENT_IP'])
			$proxy = $_SERVER['HTTP_CLIENT_IP'];
		else
			$proxy = $_SERVER['REMOTE_ADDR'];
		$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
	} else {
		if($_SERVER['HTTP_CLIENT_IP'])
			$ip = $_SERVER['HTTP_CLIENT_IP'];
		else
			$ip = $_SERVER['REMOTE_ADDR'];
	}
	if(isset($proxy))
		die('You appear to be hiding behind the proxy address: ' . $proxy);
}
?>

 

It's a bit crude, but it can be improved.

Link to comment
https://forums.phpfreaks.com/topic/137205-proxy-blocking/#findComment-717215
Share on other sites

Well I don't know of any Proxt-IP Lists, but to get started, you could use this function (or similar):

 

<?php
function detectProxy(){
	if($_SERVER['HTTP_X_FORWARDED_FOR']) {
		if($_SERVER['HTTP_CLIENT_IP'])
			$proxy = $_SERVER['HTTP_CLIENT_IP'];
		else
			$proxy = $_SERVER['REMOTE_ADDR'];
		$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
	} else {
		if($_SERVER['HTTP_CLIENT_IP'])
			$ip = $_SERVER['HTTP_CLIENT_IP'];
		else
			$ip = $_SERVER['REMOTE_ADDR'];
	}
	if(isset($proxy))
		die('You appear to be hiding behind the proxy address: ' . $proxy);
}
?>

 

It's a bit crude, but it can be improved.

 

Would this block AOL users as im told they are seen as proxy servers? Even though they are fairly legitmate ?

Link to comment
https://forums.phpfreaks.com/topic/137205-proxy-blocking/#findComment-717311
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.