Pages:
Author

Topic: [Tutorial] How to avoid visits by Proxies (Read 5565 times)

hero member
Activity: 762
Merit: 500
February 10, 2016, 03:34:35 PM
#31
I have decided to block proxy from claiming free bits /satoshi I don't stop them from accessing my website .

so I don't use php part before docktyp I just used that in main index.php to stop giving free bits when they claim .
plz how I can do this on my faucet site Smiley
hero member
Activity: 868
Merit: 500
February 10, 2016, 01:05:45 PM
#30
I have decided to block proxy from claiming free bits /satoshi I don't stop them from accessing my website .

so I don't use php part before docktyp I just used that in main index.php to stop giving free bits when they claim .
legendary
Activity: 1904
Merit: 1073
February 10, 2016, 10:55:12 AM
#29
just curious: why do you want to block proxies?
imho as long as your ad provider pays you all should be fine? or are they refusing payments in that case?

A lot of users use proxies because some countries get higher payouts from faucets. They would much rather exert the same energy / electricity and get

paid more for their efforts. Some ad providers already started blocking some faucets, because they detected these proxies being used on a large scale.

In the long run, everyone will suffer when these ad providers pull the funding for all faucet websites.  Sad
hero member
Activity: 762
Merit: 500
February 09, 2016, 06:47:01 PM
#28
I'm using second way to block proxies but it's not working Sad
sr. member
Activity: 308
Merit: 250
October 24, 2015, 10:39:23 AM
#27
My code is :

Code:
private function _checkProxyVpn() {

$ipAddress = $this->request->clientIp(false);

$bannedIps = Cache::read('ip_banned', '8week') ? Cache::read('ip_banned', '8week') : array();
if (isset($bannedIps[$ipAddress])) {
return true;
}

if (Cache::read('ip_' . $ipAddress, '1week')) {
return false;
}

if (Cache::read('getipintel_lock', '1h')) {
return false;
}

$url = sprintf('http://check.getipintel.net/check.php?ip=%[email protected]', $ipAddress);
list($httpCode, $res) = self::curlIt($url);

if ($httpCode === 200) {
$res = json_decode($res);
if ($res->status === 'success') {
if ($res->result >= 0.9) {
$bannedIps[$ipAddress] = $res->result;
Cache::write('ip_banned', $bannedIps, '8week');

return true;
}
Cache::write('ip_' . $ipAddress, $res, '1week');
} else {
$this->log($res);
}
} elseif ($httpCode === 429) {
Cache::write('getipintel_lock', 1, '1h');
} else {
$this->log($res);
}

return false;
}

It's not documented but it could help a little bit to understand the logic.
Thank you friend


sounds really interesting will test your code on my Faucet Wink


kind regrads
mari88
full member
Activity: 180
Merit: 100
October 22, 2015, 01:20:54 PM
#26
just curious: why do you want to block proxies?
imho as long as your ad provider pays you all should be fine? or are they refusing payments in that case?

What do you think ad provider is fool and many using AdSense so do you think Google is fool will pay you for proxy visit ?

AdSense will just ban if lot of proxy traffic your site get.

And also what do you think if the same user change X times his ip in order to request more and more satos without waiting minimum time?
hero member
Activity: 868
Merit: 500
October 22, 2015, 12:44:15 PM
#25
just curious: why do you want to block proxies?
imho as long as your ad provider pays you all should be fine? or are they refusing payments in that case?

What do you think ad provider is fool and many using AdSense so do you think Google is fool will pay you for proxy visit ?

AdSense will just ban if lot of proxy traffic your site get.
sr. member
Activity: 252
Merit: 250
October 22, 2015, 12:40:57 PM
#24
just curious: why do you want to block proxies?
imho as long as your ad provider pays you all should be fine? or are they refusing payments in that case?
full member
Activity: 180
Merit: 100
October 22, 2015, 12:38:11 PM
#23
I can but I use a php Framework (Take a look on CakePhp) and it uses framework functionnalities.
hero member
Activity: 868
Merit: 500
October 22, 2015, 12:32:22 PM
#22
You can not use this code like this ....

It's oop php , it's simply an example of the logic I use...

It would be nice if you share full tutorial because here many who don't understand a single word written in php like me Sad
full member
Activity: 180
Merit: 100
October 22, 2015, 12:25:15 PM
#21
You can not use this code like this ....

It's oop php , it's simply an example of the logic I use...
sr. member
Activity: 350
Merit: 250
October 22, 2015, 12:21:24 PM
#20
My code is :

Code:
private function _checkProxyVpn() {

$ipAddress = $this->request->clientIp(false);

$bannedIps = Cache::read('ip_banned', '8week') ? Cache::read('ip_banned', '8week') : array();
if (isset($bannedIps[$ipAddress])) {
return true;
}

if (Cache::read('ip_' . $ipAddress, '1week')) {
return false;
}

if (Cache::read('getipintel_lock', '1h')) {
return false;
}

$url = sprintf('http://check.getipintel.net/check.php?ip=%[email protected]', $ipAddress);
list($httpCode, $res) = self::curlIt($url);

if ($httpCode === 200) {
$res = json_decode($res);
if ($res->status === 'success') {
if ($res->result >= 0.9) {
$bannedIps[$ipAddress] = $res->result;
Cache::write('ip_banned', $bannedIps, '8week');

return true;
}
Cache::write('ip_' . $ipAddress, $res, '1week');
} else {
$this->log($res);
}
} elseif ($httpCode === 429) {
Cache::write('getipintel_lock', 1, '1h');
} else {
$this->log($res);
}

return false;
}

It's not documented but it could help a little bit to understand the logic.

PHP Parse error:  syntax error, unexpected 'private' (T_PRIVATE) in /index.php on line 2
sr. member
Activity: 350
Merit: 250
October 22, 2015, 11:49:29 AM
#19
My code is :

Code:
private function _checkProxyVpn() {

$ipAddress = $this->request->clientIp(false);

$bannedIps = Cache::read('ip_banned', '8week') ? Cache::read('ip_banned', '8week') : array();
if (isset($bannedIps[$ipAddress])) {
return true;
}

if (Cache::read('ip_' . $ipAddress, '1week')) {
return false;
}

if (Cache::read('getipintel_lock', '1h')) {
return false;
}

$url = sprintf('http://check.getipintel.net/check.php?ip=%[email protected]', $ipAddress);
list($httpCode, $res) = self::curlIt($url);

if ($httpCode === 200) {
$res = json_decode($res);
if ($res->status === 'success') {
if ($res->result >= 0.9) {
$bannedIps[$ipAddress] = $res->result;
Cache::write('ip_banned', $bannedIps, '8week');

return true;
}
Cache::write('ip_' . $ipAddress, $res, '1week');
} else {
$this->log($res);
}
} elseif ($httpCode === 429) {
Cache::write('getipintel_lock', 1, '1h');
} else {
$this->log($res);
}

return false;
}

It's not documented but it could help a little bit to understand the logic.
Thank you friend
sr. member
Activity: 350
Merit: 250
October 22, 2015, 11:42:54 AM
#18
full member
Activity: 180
Merit: 100
October 22, 2015, 11:34:42 AM
#17
My code is :

Code:
private function _checkProxyVpn() {

$ipAddress = $this->request->clientIp(false);

$bannedIps = Cache::read('ip_banned', '8week') ? Cache::read('ip_banned', '8week') : array();
if (isset($bannedIps[$ipAddress])) {
return true;
}

if (Cache::read('ip_' . $ipAddress, '1week')) {
return false;
}

if (Cache::read('getipintel_lock', '1h')) {
return false;
}

$url = sprintf('http://check.getipintel.net/check.php?ip=%[email protected]', $ipAddress);
list($httpCode, $res) = self::curlIt($url);

if ($httpCode === 200) {
$res = json_decode($res);
if ($res->status === 'success') {
if ($res->result >= 0.9) {
$bannedIps[$ipAddress] = $res->result;
Cache::write('ip_banned', $bannedIps, '8week');

return true;
}
Cache::write('ip_' . $ipAddress, $res, '1week');
} else {
$this->log($res);
}
} elseif ($httpCode === 429) {
Cache::write('getipintel_lock', 1, '1h');
} else {
$this->log($res);
}

return false;
}

It's not documented but it could help a little bit to understand the logic.
sr. member
Activity: 350
Merit: 250
October 22, 2015, 11:18:51 AM
#16
Both of them:

You check if the ip datas is in your local cache
- If yes
> process datas

- If no
> request datas from the api
> Save datas in your cache
> process datas
OK, but finally not that cache system worked me, it gave me error.
I tried others but cacheaba the page and I do not know if it generated errors with visitors at the time of receiving the reward.
full member
Activity: 180
Merit: 100
October 22, 2015, 11:14:08 AM
#15
Both of them:

You check if the ip datas is in your local cache
- If yes
> process datas

- If no
> request datas from the api
> Save datas in your cache
> process datas
sr. member
Activity: 350
Merit: 250
October 22, 2015, 03:27:07 AM
#14
Hi,

Happy to find this kind of post. I did also some protections for my faucets. The same than yours but a little bit different as it's coded inside a php framework. Also I will suggest to cache ip datas for few days to avoid useless queries to their API, as they limit calls to 1000 requests per day. (tuto for beginners: http://www.xeweb.net/2010/01/15/simple-php-caching/)

BTW, I wanna know if you have some stats related to users who use bitcoins, per percentage. Maybe we can share our analytics stats (by country) to compare?

What do you think ?
And your code would go before or after the code GetIPIntel?
sr. member
Activity: 350
Merit: 250
October 22, 2015, 03:16:30 AM
#13
Hi,

Happy to find this kind of post. I did also some protections for my faucets. The same than yours but a little bit different as it's coded inside a php framework. Also I will suggest to cache ip datas for few days to avoid useless queries to their API, as they limit calls to 1000 requests per day. (tuto for beginners: http://www.xeweb.net/2010/01/15/simple-php-caching/)

BTW, I wanna know if you have some stats related to users who use bitcoins, per percentage. Maybe we can share our analytics stats (by country) to compare?

What do you think ?
Hello, so great that the cache the compare data as my site is too new
full member
Activity: 180
Merit: 100
October 21, 2015, 11:59:09 PM
#12
Hi,

Happy to find this kind of post. I did also some protections for my faucets. The same than yours but a little bit different as it's coded inside a php framework. Also I will suggest to cache ip datas for few days to avoid useless queries to their API, as they limit calls to 1000 requests per day. (tuto for beginners: http://www.xeweb.net/2010/01/15/simple-php-caching/)

BTW, I wanna know if you have some stats related to users who use bitcoins, per percentage. Maybe we can share our analytics stats (by country) to compare?

What do you think ?
Pages:
Jump to: