Updates README to reflect changes. Uses instance name when reporting process info
This commit is contained in:
parent
da1d543d03
commit
12c00baecc
11
README.md
11
README.md
|
@ -60,19 +60,24 @@ Using the configuration file you can set a default configuration for all Tor ins
|
|||
}
|
||||
```
|
||||
|
||||
You can also specify a configuration for individual instances by setting the "instances" field to an array instead of an integer
|
||||
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.
|
||||
|
||||
```
|
||||
{
|
||||
"loadBalanceMethod": "weighted",
|
||||
"instances": [
|
||||
{
|
||||
"Name": "instance-1"
|
||||
"Weight": 10,
|
||||
"Config": {
|
||||
"DataDirectory": "/tmp/my-tor-dir1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "instance-2",
|
||||
"Weight": 5,
|
||||
"Config": {
|
||||
"DataDirectory": "/tmp/my-tor-dir2"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
@ -29,10 +29,14 @@ class TorProcess extends EventEmitter {
|
|||
}
|
||||
|
||||
new_ip() {
|
||||
this.logger.info(`[tor-${this.process.pid}]: has requested a new identity`);
|
||||
this.logger.info(`[tor-${this.instance_name}]: has requested a new identity`);
|
||||
this.process.kill('SIGHUP');
|
||||
}
|
||||
|
||||
get instance_name() {
|
||||
return (this.definition && this.definition.Name) || this.process.pid;
|
||||
}
|
||||
|
||||
get dns_port() {
|
||||
return this._dns_port || null;
|
||||
}
|
||||
|
@ -88,7 +92,7 @@ class TorProcess extends EventEmitter {
|
|||
|
||||
this.once('ready', () => {
|
||||
this.ready = true;
|
||||
this.logger && this.logger.info(`[tor-${tor.pid}]: tor is ready`);
|
||||
this.logger && this.logger.info(`[tor-${this.instance_name}]: tor is ready`);
|
||||
});
|
||||
|
||||
tor.stdout.on('data', (data) => {
|
||||
|
|
Loading…
Reference in a new issue