Post
Topic
Board Micro Earnings
Re: [Tutorial] How to avoid visits by Proxies
by
mari88
on 24/10/2015, 14:39:23 UTC
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=%s&format=json&contact=xxx@gmx.com', $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