cyberline / tor-detect
Class to determine if Remote User is using the TOR Network
v1.2
2017-03-20 14:41 UTC
Requires
- php: >=5.3.0
This package is auto-updated.
Last update: 2024-11-29 04:41:19 UTC
README
Tor is collaborative network that allows people to access sites hiding their original IP addresses to avoid being tracked. Many sites do not like to allow accesses of users that use the Tor network, as users may use anonymous access perform illegal activities. This class provides a solution that allows to determine if an user is accessing a site using the Tor network. This allows a PHP site to disallow the user to access a site using the Tor network.
Example
<?php
require_once 'src/TorDetect.php';
try {
$instance = \TorDetect\TorDetect::getInstance();
// check current users ip and
// return 1 or 0
print intval($instance->isTorActive());
// check ip of another user
print intval($instance->setTarget('1.2.3.4')->isTorActive());
} catch (\Exception $e) {
print $e->getMessage();
}