Skip to content

Node service checks whether given ip address is a Tor exit node

Notifications You must be signed in to change notification settings

laserchicken/tor-exit-nodes

Repository files navigation

Tor Exit Nodes

This service checks whether given IPv4 address is a Tor exit node.

API of the service responds:

  • with HTTP 200 OK and empty body on HEAD /A.B.C.D request when provided IP is a Tor exit node

  • with HTTP 404 Not Found and empty body on HEAD /A.B.C.D request when provided IP is not a Tor exit node

  • with HTTP 200 OK and JSON body (exitNode, lastStatus, published, exitAddress) on GET /A.B.C.D request when provided IP is a Tor exit node

  • with HTTP 404 Not Found and empty body on GET /A.B.C.D request when provided IP is not a Tor exit node

It synchronizes https://check.torproject.org/exit-addresses regularly and stores it in redis cache:

api

Tech stack

Api is based on express.js. Exit nodes synchronization worker uses node-cron package for scheduling, under the hood it basically forks a child node process. Worker and api processes communicate through redis (node-redis package), which also serves as a cache. You can customize cache expiration time and cron schedule with env variables (both are set to 30 minutes by default).

Development

Run it with docker-compose:

docker compose up

now you can query the api, for example:

curl --head http://localhost:3000/176.10.99.200

unit tests:

npm run test

TODO

About

Node service checks whether given ip address is a Tor exit node

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published