Skip to content
Zachary Boyd edited this page Sep 13, 2018 · 1 revision

Using the --config or -f command line switch you can set the path to a JSON file which can be used to load configuration on startup

The same variable names from the command line switches are used to name the keys in the JSON file.

Example:

 {
 	"controlPort": 9077,
 	"logLevel": "debug"
 }

Using the configuration file you can set a default configuration for all Tor instances

{
	"torConfig": {
		"MaxCircuitDirtiness": "10"
	}
}

You can also specify a configuration for individual instances by setting the "instances" field to an array instead of an integer.

Instances can optionally be assigned name and a weight. If the loadBalanceMethod config variable is set to "weighted" the weight field will determine how frequently the instance is used. If the instance is assigned a name the data directory will be preserved when the process is killed saving time when Tor is restarted. They can also be assigned one or more groups.

{
	"loadBalanceMethod": "weighted",
	"instances": [
		{
			"Name": "instance-1"
			"Weight": 10,
			"Config": {
			}
		},
		{
			"Name": "instance-2",
			"Weight": 5,
			"Config": {
			}
		}
	]
}

If the proxyByName (argument -n) configuration property is set to "individual" or true you can use the instance name to send requests to a specific instance. The username field in the proxy URL will identify the instance. For example, using http://instance-1:@localhost:9080 when connecting to the HTTP Proxy would route requests to "instance-1".

This feature works on the HTTP Proxy as well as the SOCKS Proxy, but not the DNS proxy since DNS lacks authentication.

Clone this wiki locally