Skip to content

koalex/tor-network-launcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TOR Network Launcher

First you need to install TOR Network:

# MAC OS example
brew update && brew install tor

Installing TNL

npm i tor-network-launcher -g

Usage

CLI:

type tnl --help to see all options

tnl --instances 3 --silent --output /temp/torNetworks.txt

Code:

import TNS from 'tor-network-launcher';

const TORNetworks = new TNS({ silent: true }); // default is false

TORNetworks.on('network', network => {
  console.info(network); // {internal: 'socks5://127.0.0.1:30400', external: 'socks5://192.168.0.77:30400'}
  console.info(TORNetworks.list); // [{internal: 'socks5://127.0.0.1:30400', external: 'socks5://192.168.0.77:30400'}, ...]
  TORNetworks.closeNetwork(network);
});

TORNetworks.on('networkError', (network, message) => {
  console.error(message); // data from sdterr of TOR process
  TORNetworks.closeNetwork(network);
});

TORNetworks.on('networkExit', (network, code) => {
  console.info(`Closing network ${network.internal}. Child process exited with code ${code}.`);
});

TORNetworks.on('error', console.error);

TORNetworks.launch(3); // Launch 3 networks. Default is 1.

This project using SemVer for versioning. For the versions available, see the tags on this repository.

This project is licensed under the MIT License - see the LICENSE file for details.

About

TOR networks launcher.

Topics

Resources

License

Stars

Watchers

Forks