2017 © Pedro Peláez
 

library tor-exits

Retrieves tor exit list from the tor project and make that available in a convenient way.

image

bramr/tor-exits

Retrieves tor exit list from the tor project and make that available in a convenient way.

  • Monday, November 21, 2016
  • by bramr
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

TorExits

A simple library to retreive a convenient list of current Tor exit nodes/relays., (*1)

Build Status Code Coverage Scrutinizer Code Quality, (*2)

Installation

The easiest way to install tor-exits is with Composer., (*3)

composer require bramr/tor-exits

Usage

$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.';
}

There is a lot more to configure, for more complex examples see: example.php, (*4)

Important

Please don't use this code to outright block users coming from the Tor network.
There are perfectly valid reasons to use Tor. (and better ways to block all Tor traffic to your site), (*5)

Also never refresh the list more than once an hour.
The consensus document is only updated hourly, so fetching an exit node list more often is pointless., (*6)

I don't use this code in production myself. I use most of it for a personal project.
If you're running into problems feel free to contact me. I don't mind helping out., (*7)

License

MIT, for details see LICENSE file., (*8)

The Versions

21/11 2016

dev-master

9999999-dev

Retrieves tor exit list from the tor project and make that available in a convenient way.

  Sources   Download

MIT

The Requires

 

The Development Requires

21/11 2016

v1.0.0

1.0.0.0

Retrieves tor exit list from the tor project and make that available in a convenient way.

  Sources   Download

MIT

The Requires

 

The Development Requires