tree: 54a6f0d484fdaa49cbe43055e49dd61f22ebd62b [path history] [tgz]
  1. files/
  2. Makefile
  3. README.md
external/subpack/net/kcptun/README.md

UCI Configuration

Most option names are the same as those used in json config files: server.json and local.json. Please check validate_xxx_options func definition of the service script and kcptun's own documentation for supported options and expected value types. And a sample config file is also provided for reference.

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 and Server options. And a client section can contain one or more options in Common options and Client options.

Every section has a disabled option to temporarily turn off the instance.

Common options

NameTypeOptionDescription
disabledbooleandisable current config section when set to 1 (default: 0)
keystring--keypre-shared secret between client and server (default: "it's a secrect")
cryptenum--cryptaes, aes-128, aes-192, salsa20, blowfish, twofish, cast5, 3des, tea, xtea, xor, sm4, none (default: "aes")
modeenum--modeprofiles: fast3, fast2, fast, normal, manual (default: "fast")
mtuinteger--mtuset maximum transmission unit for UDP packets (default: 1350)
sndwndinteger--sndwndset send window size(num of packets) (default: 1024 for server, 128 for client)
rcvwndinteger--rcvwndset receive window size(num of packets) (default: 1024 for server, 512 for client)
datashardinteger--datashard, --dsset reed-solomon erasure coding - datashard (default: 10)
parityshardinteger--parityshard, --psset reed-solomon erasure coding - parityshard (default: 3)
dscpinteger--dscpset DSCP(6bit) (default: 0)
nocompboolean--nocompdisable compression
sockbufinteger--sockbufper-socket buffer in bytes (default: 4194304)
smuxverinteger--smuxverspecify smux version, available 1,2 (default: 1)
smuxbufinteger--smuxbufthe overall de-mux buffer in bytes (default: 4194304)
streambufinteger--streambufper stream receive buffer in bytes, for smux v2+ (default: 2097152)
keepaliveinteger--keepaliveseconds between heartbeats (default: 10)
snmplogstring--snmplogcollect snmp to file, aware of timeformat in golang, like: ./snmp-20060102.log
snmpperiodinteger--snmpperiodsnmp collect period, in seconds (default: 60)
quietboolean--quietsuppress the 'stream open/close' messages
gogcintegerset GOGC environment variable, see Memory Control.
syslogbooleanredirect logs to syslog when set to 1, implemented by procd. (default: 0)
userstringrun as another user, implemented by procd.

Limitation

  • As kcptun outputs all logs to stderr by default, you may receive lots of LOG_ERR level message when set syslog to 1.

Server options

NameTypeOptionDescription
listenport number--listen, -lkcp server listen port (default: ":29900")
targethost--target, -ttarget server address (default: "127.0.0.1:12948")
target_portport number--target, -ttarget server port (default: "127.0.0.1:12948")
pprofboolean--pprofstart profiling server on :6060

Client options

NameTypeOptionDescription
bind_addressIP address--localaddr, -llocal listen address (default: ":12948")
local_portport number--localaddr, -llocal listen port (default: ":12948")
serverhost--remoteaddr, -rkcp server address (default: "vps:29900")
server_portport number--remoteaddr, -rkcp server port (default: "vps:29900")
conninteger--connset num of UDP connections to server (default: 1)
autoexpireinteger--autoexpireset auto expiration time(in seconds) for a single UDP connection, 0 to disable (default: 0)
scavengettlinteger--scavengettlset how long an expired connection can live(in sec), -1 to disable (default: 600)