-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A bit more readme and tidying up comments
- Loading branch information
sid
committed
Oct 8, 2016
1 parent
10607c4
commit 1388397
Showing
2 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,22 @@ | ||
# tor-detector | ||
# Tor Detector PHP library | ||
A library to detect if your website visitor is from a TOR network or not. | ||
|
||
At the moment this is achieved by using a DNS lookup method as described in https://trac.torproject.org/projects/tor/wiki/doc/TorDNSExitList | ||
|
||
# Credit | ||
## Usage | ||
|
||
```php | ||
$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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters