A SOCKS, HTTP and DNS proxy for distributing traffic across multiple instances of Tor
Go to file
2017-11-12 14:54:47 -08:00
bin grabs version from pacakage.json 2017-03-24 20:19:05 -04:00
src adds query instances function 2017-11-12 14:54:47 -08:00
test allows instances to be removed from pool 2017-03-24 20:11:06 -04:00
.dockerignore removes README from docker build 2017-03-24 20:15:49 -04:00
.gitignore adds control server 2017-03-22 12:45:16 -04:00
.npmignore adds npm ignore 2017-03-24 20:28:58 -04:00
bitbucket-pipelines.yml adds a README removes unsafe config options 2017-03-24 20:01:45 -04:00
docker-compose.yaml removed reference to missing env file 2017-11-12 14:07:42 -08:00
Dockerfile grabs tor repository public key in dockerfile 2017-11-12 14:49:19 -08:00
LICENSE.txt adds the apache licence 2017-03-25 23:54:41 -04:00
package.json adds query instances function 2017-11-12 14:54:47 -08:00
README.md adds line about global installation 2017-03-24 20:36:23 -04:00
tor-sources.list updates ubuntu version to 17.10 in dockerfile. uses nodejs 8. 2017-11-12 14:15:06 -08:00

Tor Router

Tor Router is a simple SOCKS5 forward proxy for distributing traffic across multiple instances of Tor. At startup Tor Router will run an arbitrary number of instances Tor an each request will be sent to a different instance in round-robin fashion. This can be used to increase anonymity, because each request will be sent on a different circut and will most likely use a different exit-node, and also to increase performance since outbound traffic is now split across several instances of Tor.

Tor Router also includes a DNS forward proxy as well, which like the SOCKS proxy will distribute traffic across multiple instances of Tor in round-robin fashion.

Building and Running

Installation requirements are node.js and tor. Make sure "tor" is in your PATH.

To install run: npm install To start run: bin/tor-router

To install globally run: npm install -g

Alternatively docker can be used. The build will retrieve the latest version of Tor from the offical Tor Project repository.

To build run: docker build -t znetstar/tor-router . To start run: docker run --rm -it -p 9050:9050 znetstar/tor-router tor-router --help

Usage

The following command line switches and their environment variable equivalents are available for use:

Command line switch Environment Variable Description
-c, --controlPort CONTROL_PORT Port the control server will bind to (see below)
-j, --instances INSTANCES Number of Tor instances to spawn
-s, --socksPort SOCKS_PORT Port the SOCKS proxy will bind to
-d, --dnsPort DNS_PORT Port the DNS proxy will bind to
-l, --logLevel LOG_LEVEL The log level, "info" by default. Set to "null" to disable logging

For example: tor-router -j 3 -s 9050 would start the proxy with 3 tor instances and listen for SOCKS connections on 9050.

Control Server

A socket.io server included will listen on port 9077 by default. Using the socket.io server the client can add/remove Tor instances and get a new identity (which includes a new ip address) while Tor Router is running.

Example (in node):

	var client = require('socket.io-client').connect('ws://localhost:9077');
	client.emit('createInstances', 3, (error) => {
		if (error) return;
		console.log('three instances created!');
		client.emit('newIps');
		console.log('clients have new ips!')
	});

Test

Tests are written in mocha, just run npm test