kcptun: add tcp option
Signed-off-by: Zheng Qian <sotux82@gmail.com>
This commit is contained in:
parent
6e0f77acbe
commit
81564a628d
3 changed files with 5 additions and 0 deletions
|
@ -26,6 +26,7 @@ Every section has a `disabled` option to temporarily turn off the instance.
|
||||||
| keepalive | integer | --keepalive | seconds between heartbeats (default: 10) |
|
| keepalive | integer | --keepalive | seconds between heartbeats (default: 10) |
|
||||||
| snmplog | string | --snmplog | collect snmp to file, aware of timeformat in golang, like: ./snmp-20060102.log |
|
| snmplog | string | --snmplog | collect snmp to file, aware of timeformat in golang, like: ./snmp-20060102.log |
|
||||||
| snmpperiod | integer | --snmpperiod | snmp collect period, in seconds (default: 60) |
|
| snmpperiod | integer | --snmpperiod | snmp collect period, in seconds (default: 60) |
|
||||||
|
| tcp | boolean | --tcp | to emulate a TCP connection(linux), need root privilege |
|
||||||
| quiet | boolean | --quiet | suppress the 'stream open/close' messages |
|
| quiet | boolean | --quiet | suppress the 'stream open/close' messages |
|
||||||
| gogc | integer | | set GOGC environment variable, see [Memory Control](https://github.com/xtaci/kcptun#memory-control). |
|
| gogc | integer | | set GOGC environment variable, see [Memory Control](https://github.com/xtaci/kcptun#memory-control). |
|
||||||
| 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) |
|
| 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) |
|
||||||
|
|
|
@ -13,6 +13,7 @@ config server
|
||||||
option snmplog '/var/log/snmp.log'
|
option snmplog '/var/log/snmp.log'
|
||||||
option snmpperiod 60
|
option snmpperiod 60
|
||||||
option pprof 1
|
option pprof 1
|
||||||
|
option tcp 0
|
||||||
option quiet 1
|
option quiet 1
|
||||||
option syslog 1
|
option syslog 1
|
||||||
option user nobody
|
option user nobody
|
||||||
|
@ -38,6 +39,7 @@ config client
|
||||||
option smuxbuf 4194304
|
option smuxbuf 4194304
|
||||||
option streambuf 2097152
|
option streambuf 2097152
|
||||||
option keepalive 10
|
option keepalive 10
|
||||||
|
option tcp 0
|
||||||
option quiet 1
|
option quiet 1
|
||||||
option gogc 20
|
option gogc 20
|
||||||
option user nobody
|
option user nobody
|
||||||
|
|
|
@ -64,6 +64,7 @@ kcptun() {
|
||||||
[ -z "$keepalive" ] || json_add_int keepalive "$keepalive"
|
[ -z "$keepalive" ] || json_add_int keepalive "$keepalive"
|
||||||
[ -z "$snmplog" ] || json_add_string snmplog "$snmplog"
|
[ -z "$snmplog" ] || json_add_string snmplog "$snmplog"
|
||||||
[ -z "$snmpperiod" ] || json_add_int snmpperiod "$snmpperiod"
|
[ -z "$snmpperiod" ] || json_add_int snmpperiod "$snmpperiod"
|
||||||
|
json_add_boolean tcp "$tcp"
|
||||||
json_add_boolean quiet "$quiet"
|
json_add_boolean quiet "$quiet"
|
||||||
json_dump -i > "$confjson"
|
json_dump -i > "$confjson"
|
||||||
|
|
||||||
|
@ -140,6 +141,7 @@ validate_common_options() {
|
||||||
'keepalive:uinteger' \
|
'keepalive:uinteger' \
|
||||||
'snmplog:string' \
|
'snmplog:string' \
|
||||||
'snmpperiod:uinteger' \
|
'snmpperiod:uinteger' \
|
||||||
|
'tcp:bool' \
|
||||||
'quiet:bool' \
|
'quiet:bool' \
|
||||||
'gogc:uinteger' \
|
'gogc:uinteger' \
|
||||||
'syslog:bool:1' \
|
'syslog:bool:1' \
|
||||||
|
|
Loading…
Reference in a new issue