Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ryanj93/tor-detector
A very simple library to detect Tor connections using Node.js without any dependency.
https://github.com/ryanj93/tor-detector
javascript javascript-library node-js node-module nodejs tor tor-detector
Last synced: 28 days ago
JSON representation
A very simple library to detect Tor connections using Node.js without any dependency.
- Host: GitHub
- URL: https://github.com/ryanj93/tor-detector
- Owner: RyanJ93
- License: gpl-3.0
- Created: 2018-02-11T09:04:01.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-24T08:43:29.000Z (almost 7 years ago)
- Last Synced: 2024-11-20T01:51:42.583Z (about 1 month ago)
- Topics: javascript, javascript-library, node-js, node-module, nodejs, tor, tor-detector
- Language: JavaScript
- Size: 21.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Tor detector
A very simple library to detect Tor connections using Node.js without any dependency.
# 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:`TorDetector.setListPath('nodes.txt');`
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:
`TorDetector.updateFile().then(function(){}).catch(function(error){});`
Once you have the list, you can check if an IP address is part of the Tor network by using this method:
`TorDetector.isTor('IP ADDRESS HERE', false).then(function(){}).catch(function(error){});`
This method can be used both in synchronous and asynchronous way.
If you are running a server and want to get the IP address of the client you can use this method:`TorDetector.getClientIPAddress(request);`
Are you looking for the PHP version? Give a look [here](https://github.com/RyanJ93/php-tor-detector).