2017 © Pedro Peláez
 

library tor-detector

Tor Detector - a library to detect if your website visitor is using TOR

image

onlinesid/tor-detector

Tor Detector - a library to detect if your website visitor is using TOR

  • Monday, November 21, 2016
  • by onlinesid
  • Repository
  • 2 Watchers
  • 4 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 17 % Grown

The README.md

Tor Detector PHP library

A library to detect if your website visitor is from a TOR network or not., (*1)

At the moment this is achieved by using a DNS lookup method as described in https://trac.torproject.org/projects/tor/wiki/doc/TorDNSExitList, (*2)

Composer

https://packagist.org/packages/onlinesid/tor-detector, (*3)

Usage

$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";
}

Credit

Original code is taken from https://jrnv.nl/detecting-the-use-of-proxies-and-tor-network-6c240d6cc5f (it wasn't working but very close), (*4)

The Versions

21/11 2016

dev-master

9999999-dev https://github.com/onlinesid/tor-detector

Tor Detector - a library to detect if your website visitor is using TOR

  Sources   Download

MIT

detector tor tor browser

08/10 2016

v0.0.2

0.0.2.0 https://github.com/onlinesid/tor-detector

Detect if your website visitor is from a TOR exit node

  Sources   Download

MIT

detector tor tor browser

08/10 2016

v0.0.1

0.0.1.0 https://github.com/onlinesid/tor-detector

Detect if your website visitor is from a TOR exit node

  Sources   Download

MIT

detector tor tor browser