PHP code example of onlinesid / tor-detector

1. Go to this page and download the library: Download onlinesid/tor-detector library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

onlinesid / tor-detector example snippets


$tor_detector = new OnlineSid\Tor\TorDetector();

$your_server_ip = '1.2.3.4'; // the IP address of your server (web server)
$user_ip = '62.102.148.67'; // is this IP from TOR exit node?

if ($tor_detector->check($user_ip, 80, $your_server_ip)) {
    echo "Tor!\n";
} else {
    echo "Not TOR!\n";
}