Skip to content

k4m4/tor-detect

Repository files navigation

tor-detect Build Status

Detect whether an IP address belongs to a Tor exit node.

Install

~ ❯❯❯ npm install --save tor-detect

Usage

const torDetect = require('tor-detect');

torDetect('176.31.45.3').then(tor => {
	console.log(tor);
	//=> true
});

torDetect('8.8.8.8').then(tor => {
	console.log(tor);
	//=> false
});

API

torDetect(targets, [options])

Returns a Promise for a boolean which is true if any of the targets belongs to Tor.

targets

Type: string Array

options

timeout

Type: number

Timeout in milliseconds after which a request is considered failed. Default: 5000.

Credits

  • check.torproject.org - A list of all Tor exit nodes from the past 16 hours that can contact 1.1.1.1 on port 80
  • dan.me.uk - A page containing a full TOR nodelist.

Related

  • tor-detect.now - A minimal service to check whether a visitor is running behing Tor.

License

MIT © Nikolaos Kamarinakis

About

Detect whether an IP address belongs to a Tor exit node.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published