2017 © Pedro Peláez
 

library php-tor-detector

A very simple library to detect Tor connections using PHP 7 without any dependency.

image

ryanj93/php-tor-detector

A very simple library to detect Tor connections using PHP 7 without any dependency.

  • Saturday, February 24, 2018
  • by ryanj93
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Tor detector

A very simple library to detect Tor connections using PHP 7 without any dependency., (*1)

Usage

Before using the library, you have to set the path to the file that contains the list of all Tor exit points, if you don't have the list you can set an arbitrary file name instead. To set the library path, use this method:, (*2)

PHPTorDetector\PHPTorDetector::setListPath('nodes.txt');, (*3)

If the file doesn't exist or is empty or you just want to update its content, you can use this method to download the updated list and overwrite new list in the file:, (*4)

PHPTorDetector\PHPTorDetector::updateFile();, (*5)

Once you have the list, you can check if an IP address is part of the Tor network by using this method:, (*6)

$result = PHPTorDetector\PHPTorDetector::isTor('IP ADDRESS HERE');, (*7)

If you want to get the IP address of the client you can use this method:, (*8)

$address = PHPTorDetector\PHPTorDetector::getClientIPAddress();, (*9)

By default, check result is cached within session (if session is enabled and if the script is not executed in CLI), you can disable this feature by using this method:, (*10)

PHPTorDetector\PHPTorDetector::setSessionCache(false);, (*11)

If you want to change the index where the results will be cached you can use this method:, (*12)

PHPTorDetector\PHPTorDetector::setSessionCacheName('tor_cache');, (*13)

Note that if you want to set multiple indexes within the session array you can separate indexes with a "@" like this:, (*14)

PHPTorDetector\PHPTorDetector::setSessionCacheName('tor@cache');, (*15)

In this way, cache will be stored in $_SESSION['tor']['cache']., (*16)

Are you looking for the Node.js version? Give a look here., (*17)

The Versions

24/02 2018

dev-master

9999999-dev https://github.com/RyanJ93/php-tor-detector#readme

A very simple library to detect Tor connections using PHP 7 without any dependency.

  Sources   Download

GPL-3.0-or-later

The Requires

  • php >=7.0

 

The Development Requires

  • php >=7.0

validator security proxy utilities tor

24/02 2018

1.1.2

1.1.2.0 https://github.com/RyanJ93/php-tor-detector#readme

A very simple library to detect Tor connections using PHP 7 without any dependency.

  Sources   Download

GPL-3.0-or-later

The Requires

  • php >=7.0

 

The Development Requires

  • php >=7.0

validator security proxy utilities tor

19/02 2018

1.1.1

1.1.1.0 https://github.com/RyanJ93/php-tor-detector#readme

A very simple library to detect Tor connections using PHP 7 without any dependency.

  Sources   Download

GPL-3.0-or-later

The Requires

  • php >=7.0

 

The Development Requires

  • php >=7.0

validator security proxy utilities tor