docs(config): add more comments
This commit is contained in:
parent
b6b30b4288
commit
54a88afe2f
100
bin/cli-init.js
100
bin/cli-init.js
@ -16,27 +16,95 @@ function random(array, len) {
|
||||
return randomIndexes.map((char) => array[char % size]).join('');
|
||||
}
|
||||
|
||||
const js = `
|
||||
module.exports = {
|
||||
const key = random('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+<>?:|{}-=[];,./ABCDEFGHIJKLMNOPQRSTUVWXYZ', 16);
|
||||
|
||||
const js = `module.exports = {
|
||||
|
||||
/**
|
||||
* local hostname or ip address
|
||||
*
|
||||
* @note
|
||||
* 1. For client, act as a Socks5/Socks4/HTTP server.
|
||||
* 2. For server, act as a blinksocks server.
|
||||
*/
|
||||
"host": "localhost",
|
||||
"port": 1080,
|
||||
"servers": [],
|
||||
"key": "${random('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+<>?:|{}-=[];,./ABCDEFGHIJKLMNOPQRSTUVWXYZ', 16)}",
|
||||
"presets": [{
|
||||
"name": "ss-base",
|
||||
"params": {}
|
||||
}, {
|
||||
"name": "ss-aead-cipher",
|
||||
"params": {
|
||||
"method": "aes-256-gcm",
|
||||
"info": "ss-subkey"
|
||||
|
||||
/**
|
||||
* local port to be listen on
|
||||
*/
|
||||
"port": 5555,
|
||||
|
||||
/**
|
||||
* a list of blinksocks/shadowsocks server
|
||||
*
|
||||
* @note
|
||||
* 1. You can disable an item by prefixing a '-'.
|
||||
* 2. Optional, used only on CLIENT.
|
||||
* 3. Each item should be formed with "host:port".
|
||||
*/
|
||||
"servers": [
|
||||
|
||||
],
|
||||
|
||||
/**
|
||||
* a secret key for encryption/description
|
||||
*/
|
||||
"key": "${key}",
|
||||
|
||||
/**
|
||||
* presets to process data stream
|
||||
*
|
||||
* @note
|
||||
* 1. DO NOT modify the first preset if you don't know what it is.
|
||||
* 2. Take care the order of those presets, read the docs before changing them.
|
||||
*/
|
||||
"presets": [
|
||||
{
|
||||
// preset name
|
||||
"name": "ss-base",
|
||||
// preset parameters
|
||||
"params": {}
|
||||
},
|
||||
{
|
||||
"name": "ss-aead-cipher",
|
||||
"params": {
|
||||
"method": "aes-256-gcm",
|
||||
"info": "ss-subkey"
|
||||
}
|
||||
}
|
||||
}],
|
||||
],
|
||||
|
||||
/**
|
||||
* redirect data stream to here once preset fail to process
|
||||
*
|
||||
* @note
|
||||
* 1. should be formed with "host:port".
|
||||
*/
|
||||
"redirect": "",
|
||||
|
||||
/**
|
||||
* close inactive connection after timeout seconds
|
||||
*/
|
||||
"timeout": 600,
|
||||
"log_level": "info",
|
||||
|
||||
/**
|
||||
* collect performance statistics
|
||||
*/
|
||||
"profile": false,
|
||||
"watch": true
|
||||
|
||||
/**
|
||||
* hot-reload when this file changed
|
||||
*/
|
||||
"watch": true,
|
||||
|
||||
/**
|
||||
* log by the level
|
||||
*
|
||||
* @note
|
||||
* 1. should be one of [error, warn, info, verbose, debug, silly]
|
||||
*/
|
||||
"log_level": "info"
|
||||
|
||||
};`;
|
||||
|
||||
const file = 'blinksocks.config.js';
|
||||
|
@ -1,14 +1,13 @@
|
||||
# Configuration
|
||||
|
||||
To start a server or a client, you prepare a json or js file(`config.json/config.js` for example) first,
|
||||
then supply it to `--config` or `-c`:
|
||||
|
||||
```
|
||||
$ blinksocks -c config.js
|
||||
```
|
||||
|
||||
## Template
|
||||
|
||||
You can use blinksocks init to generate a `blinksocks.config.js`:
|
||||
|
||||
```
|
||||
$ blinksocks init
|
||||
```
|
||||
|
||||
**config.json**
|
||||
|
||||
```json
|
||||
@ -49,6 +48,15 @@ module.exports = {
|
||||
};
|
||||
```
|
||||
|
||||
## Run blinksocks
|
||||
|
||||
To start a server or a client, you prepare a json or js file(`config.json/config.js` for example) first,
|
||||
then supply it to `--config` or `-c`:
|
||||
|
||||
```
|
||||
$ blinksocks -c config.js
|
||||
```
|
||||
|
||||
## Description
|
||||
|
||||
| FIELD | DESCRIPTION | EXAMPLE |
|
||||
|
Loading…
Reference in New Issue
Block a user