PHPackages                             profburial/tordetect - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. profburial/tordetect

ActiveLibrary[Security](/categories/security)

profburial/tordetect
====================

Easily detect tor users.

v1.1(10y ago)437MITPHPPHP &gt;=5.4.0

Since May 19Pushed 10y ago2 watchersCompare

[ Source](https://github.com/profburial/tordetect)[ Packagist](https://packagist.org/packages/profburial/tordetect)[ RSS](/packages/profburial-tordetect/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Tor Exit Node Detection
=======================

[](#tor-exit-node-detection)

I love Tor and most everything it represents. However, in certain use cases, people can use Tor to be jerks.

\*\*\* Disclaimer \*\*\*

You probably shouldn't use this lib as is if you are wanting to do anything serious. It maintains a json file with a list of Tor exit nodes that should be stored elsewhere for more serious applications.

Support
-------

[](#support)

If you use this library or it's components in a commercial project please consider a [moral license](https://www.creatorlove.com/terry-harmon/tor-detect)

Installation
------------

[](#installation)

```
composer require profburial/tordetect 1.1

```

Usage
-----

[](#usage)

Create a writable json file to store your ip data.

```
// Get a list of Tor exit nodes
$ips = (new ProfBurial\TorDetect\Client(
    __DIR__."/_data/torexitnodes.json", // File for storing ips
    24 // Update every 24 hours
))->get();

// array(1067) {
//   [0]=>
//   string(13) "1.169.207.157"
//   [1]=>
//   string(12) "2.107.22.186"
//   [2]=>
//   string(11) "2.111.64.26"
//   [3]=>
//   string(11) "2.221.39.34"
//   ...
// }

// Check an ip address against your list of exit nodes
$check = (new ProfBurial\TorDetect\Client(
    __DIR__."/_data/torexitnodes.json", // File for storing ips
    24 // Update every 24 hours
))->check('127.0.0.1');

// bool(false) if not found
// '127.0.0.1' if found
```

Tests
-----

[](#tests)

Unit:

```
phpunit tests/ClientUnitTest.php

```

Integration:

```
phpunit tests/ClientIntegrationTest.php

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~218 days

Total

2

Last Release

3799d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0a5b7ef1c70589891c9ca6c551bb1a0496fe0994823e3d05a775eac9edb5d660?d=identicon)[profburial](/maintainers/profburial)

---

Top Contributors

[![profburial](https://avatars.githubusercontent.com/u/2905966?v=4)](https://github.com/profburial "profburial (9 commits)")

---

Tags

tor

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/profburial-tordetect/health.svg)

```
[![Health](https://phpackages.com/badges/profburial-tordetect/health.svg)](https://phpackages.com/packages/profburial-tordetect)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41478.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

87117.5M63](/packages/bjeavons-zxcvbn-php)[illuminate/encryption

The Illuminate Encryption package.

9229.7M280](/packages/illuminate-encryption)[paragonie/hidden-string

Encapsulate strings in an object to hide them from stack traces

7410.6M39](/packages/paragonie-hidden-string)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
