gitolite: update to 3.6.13
[feed/packages.git] / net / kcptun / README.md
1 # UCI Configuration
2 Most option names are the same as those used in json config files: [`server.json`](https://github.com/xtaci/kcptun/blob/master/examples/server.json) and [`local.json`](https://github.com/xtaci/kcptun/blob/master/examples/local.json). Please check `validate_xxx_options` func definition of the [service script](files/kcptun.init) and kcptun's own [documentation](https://github.com/xtaci/kcptun) for supported options and expected value types. And a [sample config file](files/kcptun.config) is also provided for reference.
3
4 A `kcptun` config file can contain two types of config section: `server` and `client`, one of which represents a server or client instance. A `server` section can contain one or more options in [Common options](#common-options) and [Server options](#server-options). And a `client` section can contain one or more options in [Common options](#common-options) and [Client options](#client-options).
5
6 Every section has a `disabled` option to temporarily turn off the instance.
7
8 ## [Common options](#common-options)
9 | Name | Type | Option | Description |
10 | ---- | ---- | ------ | ----------- |
11 | disabled | boolean | | disable current config section when set to 1 (default: 0) |
12 | key | string | --key | pre-shared secret between client and server (default: "it's a secrect") |
13 | crypt | enum | --crypt | aes, aes-128, aes-192, salsa20, blowfish, twofish, cast5, 3des, tea, xtea, xor, sm4, none (default: "aes") |
14 | mode | enum | --mode | profiles: fast3, fast2, fast, normal, manual (default: "fast") |
15 | mtu | integer | --mtu | set maximum transmission unit for UDP packets (default: 1350) |
16 | sndwnd | integer | --sndwnd | set send window size(num of packets) (default: 1024 for server, 128 for client) |
17 | rcvwnd | integer | --rcvwnd | set receive window size(num of packets) (default: 1024 for server, 512 for client) |
18 | datashard | integer | --datashard, --ds | set reed-solomon erasure coding - datashard (default: 10) |
19 | parityshard | integer | --parityshard, --ps | set reed-solomon erasure coding - parityshard (default: 3) |
20 | dscp | integer | --dscp | set DSCP(6bit) (default: 0) |
21 | nocomp | boolean | --nocomp | disable compression |
22 | sockbuf | integer | --sockbuf | per-socket buffer in bytes (default: 4194304) |
23 | smuxver | integer | --smuxver | specify smux version, available 1,2 (default: 1) |
24 | smuxbuf | integer | --smuxbuf | the overall de-mux buffer in bytes (default: 4194304) |
25 | streambuf | integer | --streambuf | per stream receive buffer in bytes, for smux v2+ (default: 2097152) |
26 | keepalive | integer | --keepalive | seconds between heartbeats (default: 10) |
27 | snmplog | string | --snmplog | collect snmp to file, aware of timeformat in golang, like: ./snmp-20060102.log |
28 | snmpperiod | integer | --snmpperiod | snmp collect period, in seconds (default: 60) |
29 | tcp | boolean | --tcp | to emulate a TCP connection(linux), need root privilege |
30 | quiet | boolean | --quiet | suppress the 'stream open/close' messages |
31 | gogc | integer | | set GOGC environment variable, see [Memory Control](https://github.com/xtaci/kcptun#memory-control). |
32 | syslog | boolean | | redirect logs to syslog when set to 1, implemented by [procd](https://openwrt.org/docs/guide-developer/procd-init-scripts#service_parameters). (default: 0) |
33 | user | string | | run as another user, implemented by [procd](https://openwrt.org/docs/guide-developer/procd-init-scripts#service_parameters). |
34
35 ### Limitation
36 * As kcptun outputs all logs to stderr by default, you may receive lots of **LOG_ERR** level message when set syslog to 1.
37
38 ## [Server options](#server-options)
39 | Name | Type | Option | Description |
40 | ---- | ---- | ------ | ----------- |
41 | listen | port number | --listen, -l | kcp server listen port (default: ":29900") |
42 | target | host | --target, -t | target server address (default: "127.0.0.1:12948") |
43 | target_port | port number | --target, -t | target server port (default: "127.0.0.1:12948") |
44 | pprof | boolean | --pprof | start profiling server on :6060 |
45
46 ## [Client options](#client-options)
47 | Name | Type | Option | Description |
48 | ---- | ---- | ------ | ----------- |
49 | bind_address | IP address | --localaddr, -l | local listen address (default: ":12948") |
50 | local_port | port number | --localaddr, -l | local listen port (default: ":12948") |
51 | server | host | --remoteaddr, -r | kcp server address (default: "vps:29900") |
52 | server_port | port number | --remoteaddr, -r | kcp server port (default: "vps:29900") |
53 | conn | integer | --conn | set num of UDP connections to server (default: 1) |
54 | autoexpire | integer | --autoexpire | set auto expiration time(in seconds) for a single UDP connection, 0 to disable (default: 0) |
55 | scavengettl | integer | --scavengettl | set how long an expired connection can live(in sec), -1 to disable (default: 600) |