tor-router/docs/index.html
2018-09-25 12:53:29 -04:00

164 lines
13 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Home - Documentation</title>
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
<label for="nav-trigger" class="overlay"></label>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ControlServer.html">ControlServer</a><ul class='methods'><li data-type='method'><a href="ControlServer.html#.instance_info">instance_info</a></li><li data-type='method'><a href="ControlServer.html#close">close</a></li><li data-type='method'><a href="ControlServer.html#createDNSServer">createDNSServer</a></li><li data-type='method'><a href="ControlServer.html#createHTTPServer">createHTTPServer</a></li><li data-type='method'><a href="ControlServer.html#createSOCKSServer">createSOCKSServer</a></li><li data-type='method'><a href="ControlServer.html#createTorPool">createTorPool</a></li><li data-type='method'><a href="ControlServer.html#listen">listen</a></li><li data-type='method'><a href="ControlServer.html#listenTcp">listenTcp</a></li><li data-type='method'><a href="ControlServer.html#listenWs">listenWs</a></li></ul></li><li><a href="DNSServer.html">DNSServer</a><ul class='methods'><li data-type='method'><a href="DNSServer.html#listen">listen</a></li></ul></li><li><a href="HTTPServer.html">HTTPServer</a><ul class='methods'><li data-type='method'><a href="HTTPServer.html#listen">listen</a></li></ul></li><li><a href="SOCKSServer.html">SOCKSServer</a><ul class='methods'><li data-type='method'><a href="SOCKSServer.html#listen">listen</a></li></ul></li><li><a href="TorPool.html">TorPool</a><ul class='methods'><li data-type='method'><a href="TorPool.html#add">add</a></li><li data-type='method'><a href="TorPool.html#add_instance_to_group">add_instance_to_group</a></li><li data-type='method'><a href="TorPool.html#add_instance_to_group_at">add_instance_to_group_at</a></li><li data-type='method'><a href="TorPool.html#add_instance_to_group_by_name">add_instance_to_group_by_name</a></li><li data-type='method'><a href="TorPool.html#create">create</a></li><li data-type='method'><a href="TorPool.html#create_instance">create_instance</a></li><li data-type='method'><a href="TorPool.html#exit">exit</a></li><li data-type='method'><a href="TorPool.html#get_config_at">get_config_at</a></li><li data-type='method'><a href="TorPool.html#get_config_by_name">get_config_by_name</a></li><li data-type='method'><a href="TorPool.html#instance_at">instance_at</a></li><li data-type='method'><a href="TorPool.html#instance_by_name">instance_by_name</a></li><li data-type='method'><a href="TorPool.html#instances_by_group">instances_by_group</a></li><li data-type='method'><a href="TorPool.html#new_identites">new_identites</a></li><li data-type='method'><a href="TorPool.html#new_identites_by_group">new_identites_by_group</a></li><li data-type='method'><a href="TorPool.html#new_identity_at">new_identity_at</a></li><li data-type='method'><a href="TorPool.html#new_identity_by_name">new_identity_by_name</a></li><li data-type='method'><a href="TorPool.html#next">next</a></li><li data-type='method'><a href="TorPool.html#next_by_group">next_by_group</a></li><li data-type='method'><a href="TorPool.html#remove">remove</a></li><li data-type='method'><a href="TorPool.html#remove_at">remove_at</a></li><li data-type='method'><a href="TorPool.html#remove_by_name">remove_by_name</a></li><li data-type='method'><a href="TorPool.html#remove_instance_from_group">remove_instance_from_group</a></li><li data-type='method'><a href="TorPool.html#remove_instance_from_group_at">remove_instance_from_group_at</a></li><li data-type='method'><a href="TorPool.html#remove_instance_from_group_by_name">remove_instance_from_group_by_name</a></li><li data-type='method'><a href="TorPool.html#set_config_all">set_config_all</a></li><li data-type='method'><a href="TorPool.html#set_config_at">set_config_at</a></li><li data-type='method'><a href="TorPool.html#set_config_by_group">set_config_by_group</a></li><li data-type='method'><a href="TorPool.html#set_config_by_name">set_config_by_name</a></li><li data-type='method'><a href="TorPool.html#signal_all">signal_all</a></li><li data-type='method'><a href="TorPool.html#signal_at">signal_at</a></li><li data-type='method'><a href="TorPool.html#signal_by_group">signal_by_group</a></li><li data-type='method'><a href="TorPool.html#signal_by_name">signal_by_name</a></li></ul></li><li><a href="TorProcess.html">TorProcess</a><ul class='methods'><li data-type='method'><a href="TorProcess.html#create">create</a></li><li data-type='method'><a href="TorProcess.html#exit">exit</a></li><li data-type='method'><a href="TorProcess.html#get_config">get_config</a></li><li data-type='method'><a href="TorProcess.html#new_identity">new_identity</a></li><li data-type='method'><a href="TorProcess.html#set_config">set_config</a></li><li data-type='method'><a href="TorProcess.html#signal">signal</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-tor-router.html">tor-router</a></li><li><a href="module-tor-router_ControlServer.html">tor-router/ControlServer</a></li><li><a href="module-tor-router_default_config.html">tor-router/default_config</a></li><li><a href="module-tor-router_default_ports.html">tor-router/default_ports</a></li><li><a href="module-tor-router_DNSServer.html">tor-router/DNSServer</a></li><li><a href="module-tor-router_HTTPServer.html">tor-router/HTTPServer</a></li><li><a href="module-tor-router_launch.html">tor-router/launch</a></li><li><a href="module-tor-router_nconf_load_env.html">tor-router/nconf_load_env</a></li><li><a href="module-tor-router_SOCKSServer.html">tor-router/SOCKSServer</a></li><li><a href="module-tor-router_TorPool.html">tor-router/TorPool</a></li><li><a href="module-tor-router_TorProcess.html">tor-router/TorProcess</a></li><li><a href="module-tor-router_winston_silent_logger.html">tor-router/winston_silent_logger</a></li></ul><h3>Events</h3><ul><li><a href="DNSServer.html#event:instance-connection">instance-connection</a></li><li><a href="HTTPServer.html#event:instance-connection">instance-connection</a></li><li><a href="SOCKSServer.html#event:instance-connection">instance-connection</a></li><li><a href="TorPool.html#event:instance_created">instance_created</a></li><li><a href="TorProcess.html#event:control_listen">control_listen</a></li><li><a href="TorProcess.html#event:controller_ready">controller_ready</a></li><li><a href="TorProcess.html#event:dns_listen">dns_listen</a></li><li><a href="TorProcess.html#event:error">error</a></li><li><a href="TorProcess.html#event:process_exit">process_exit</a></li><li><a href="TorProcess.html#event:ready">ready</a></li><li><a href="TorProcess.html#event:socks_listen">socks_listen</a></li></ul><h3>Global</h3><ul><li><a href="global.html#assembleHost">assembleHost</a></li><li><a href="global.html#cleanUp">cleanUp</a></li><li><a href="global.html#env_whitelist">env_whitelist</a></li><li><a href="global.html#logger">logger</a></li><li><a href="global.html#main">main</a></li><li><a href="global.html#nconf">nconf</a></li><li><a href="global.html#REALM">REALM</a></li><li><a href="global.html#setup_nconf_env">setup_nconf_env</a></li><li><a href="global.html#TOR_ROUTER_PROXY_AGENT">TOR_ROUTER_PROXY_AGENT</a></li></ul>
</nav>
<div id="main">
<section class="readme">
<article><h1>Tor Router</h1><p><a href="https://nodei.co/npm/tor-router/"><img src="https://nodei.co/npm/tor-router.png" alt="NPM"></a></p>
<p><a href="https://app.fossa.io/projects/git%2Bgithub.com%2Fznetstar%2Ftor-router?ref=badge_shield"><img src="https://app.fossa.io/api/projects/git%2Bgithub.com%2Fznetstar%2Ftor-router.svg?type=shield" alt="FOSSA Status"></a></p>
<p><em>Tor Router</em> is a SOCKS5, DNS and HTTP proxy server for distributing traffic across multiple instances of Tor. At startup Tor Router will run an arbitrary number of instances Tor and 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 circuit 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.</p>
<p>A list of changes can be <a href="https://github.com/znetstar/tor-router/blob/master/CHANGELOG.md">found here</a>.</p>
<h2>Building and Running</h2><p>The only installation requirement is node.js. Tor is bundled with the application. To use an external Tor executable use the <code>--torPath</code> command line switch or set the <code>TOR_PATH</code> environment variable.</p>
<p>To install run: <code>npm install</code>
To start run: <code>bin/tor-router</code></p>
<p>To install globally run: <code>npm install -g tor-router</code></p>
<p>Alternatively docker can be used. The build will retrieve the latest version of Tor from the offical Tor Project repository.</p>
<p>To build run: <code>docker build -t znetstar/tor-router .</code>
To start run: <code>docker run --rm -it -p 9050:9050 znetstar/tor-router</code></p>
<h2>Usage</h2><p>The following command line switches and their environment variable equivalents are available for use:</p>
<p>If just a port number is passed in place of a host, it will bind to all interfaces.</p>
<table>
<thead>
<tr>
<th>Command line switch</th>
<th>Environment Variable</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>-f, --config</td>
<td></td>
<td>Path to a JSON configuration file to use</td>
</tr>
<tr>
<td>-c, --controlHost</td>
<td>CONTROL_HOST</td>
<td>Host the control server will bind to and listen for TCP traffic (see below)</td>
</tr>
<tr>
<td>-w, --websocketControlHost</td>
<td>WEBSOCKET_CONTROL_HOST</td>
<td>Host the control server will bind to and listen for WebSocket traffic</td>
</tr>
<tr>
<td>-j, --instances</td>
<td>INSTANCES</td>
<td>Number of Tor instances to spawn</td>
</tr>
<tr>
<td>-s, --socksHost</td>
<td>SOCKS_HOST</td>
<td>Host the SOCKS proxy will bind to</td>
</tr>
<tr>
<td>-d, --dnsHost</td>
<td>DNS_HOST</td>
<td>Host the DNS proxy will bind to</td>
</tr>
<tr>
<td>-h, --httpHost</td>
<td>HTTP_HOST</td>
<td>Host the HTTP proxy will bind to</td>
</tr>
<tr>
<td>-l, --logLevel</td>
<td>LOG_LEVEL</td>
<td>Log level (defaults to &quot;info&quot;) set to &quot;null&quot; to disable logging. To see a log of all network traffic set logLevel to &quot;verbose&quot;</td>
</tr>
<tr>
<td>-p, --parentDataDirectory</td>
<td>PARENT_DATA_DIRECTORY</td>
<td>Parent directory that will contain the data directories for the instances</td>
</tr>
<tr>
<td>-b, --loadBalanceMethod</td>
<td>LOAD_BALANCE_METHOD</td>
<td>Method that will be used to sort the instances between each request. Currently supports &quot;round_robin&quot; and &quot;weighted&quot;.</td>
</tr>
<tr>
<td>-t, --torPath</td>
<td>TOR_PATH</td>
<td>Provide the path for the Tor executable that will be used</td>
</tr>
<tr>
<td>-n, --proxyByName</td>
<td>PROXY_BY_NAME</td>
<td>Controls how authenticated requests will be handled. Can be set to &quot;individual&quot;, &quot;group&quot; or false to disable</td>
</tr>
</tbody>
</table>
<p>A full list of all available configuration options and their defaults can be found in <a href="https://github.com/znetstar/tor-router/blob/master/src/default_config.js">default_config.js</a></p>
<p>For example: <code>tor-router -j 3 -s 127.0.0.1:9050</code> would start the proxy with 3 tor instances and listen for SOCKS connections on localhost:9050.</p>
<h2>Documentation</h2><p>For detailed examples and insturctions on using Tor Router <a href="https://github.com/znetstar/tor-router/wiki">see the wiki</a>.</p>
<p>Documentation is available in <code>docs/</code>. An online version of the documentation is also <a href="https://tor-router.docs.zacharyboyd.nyc/">available here</a>. </p>
<h2>Testing</h2><p>Tests are written in mocha and can be found under <code>test/</code> and can be run with <code>npm test</code></p></article>
</section>
</div>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Sep 25 2018 12:53:23 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>
<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
</body>
</html>