PHP code example of bramr / tor-exits
1. Go to this page and download the library: Download bramr/tor-exits 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/ */
bramr / tor-exits example snippets
$clientIp = '127.0.0.1';
//simplest example using tor project exit node list
$parser = new TorProjectParser(new TorProjectCollector());
$ipList = IpList::fromParserWithCache($parser, new IpListJsonCache());
if ($ipList->contains($clientIp)) {
echo 'client uses Tor.';
}