You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
4.5 KiB

  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. 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).
  4. Every section has a `disabled` option to temporarily turn off the instance.
  5. ## [Common options](#common-options)
  6. | Name | Type | Option | Description |
  7. | ---- | ---- | ------ | ----------- |
  8. | disabled | boolean | | disable current config section when set to 1 (default: 0) |
  9. | key | string | --key | pre-shared secret between client and server (default: "it's a secrect") |
  10. | crypt | enum | --crypt | aes, aes-128, aes-192, salsa20, blowfish, twofish, cast5, 3des, tea, xtea, xor, sm4, none (default: "aes") |
  11. | mode | enum | --mode | profiles: fast3, fast2, fast, normal, manual (default: "fast") |
  12. | mtu | integer | --mtu | set maximum transmission unit for UDP packets (default: 1350) |
  13. | sndwnd | integer | --sndwnd | set send window size(num of packets) (default: 1024 for server, 128 for client) |
  14. | rcvwnd | integer | --rcvwnd | set receive window size(num of packets) (default: 1024 for server, 512 for client) |
  15. | datashard | integer | --datashard, --ds | set reed-solomon erasure coding - datashard (default: 10) |
  16. | parityshard | integer | --parityshard, --ps | set reed-solomon erasure coding - parityshard (default: 3) |
  17. | dscp | integer | --dscp | set DSCP(6bit) (default: 0) |
  18. | nocomp | boolean | --nocomp | disable compression |
  19. | sockbuf | integer | --sockbuf | per-socket buffer in bytes (default: 4194304) |
  20. | smuxbuf | integer | --smuxbuf | the overall de-mux buffer in bytes (default: 4194304) |
  21. | keepalive | integer | --keepalive | seconds between heartbeats (default: 10) |
  22. | snmplog | string | --snmplog | collect snmp to file, aware of timeformat in golang, like: ./snmp-20060102.log |
  23. | snmpperiod | integer | --snmpperiod | snmp collect period, in seconds (default: 60) |
  24. | quiet | boolean | --quiet | suppress the 'stream open/close' messages |
  25. | gogc | integer | | set GOGC environment variable, see [Memory Control](https://github.com/xtaci/kcptun#memory-control). |
  26. | 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) |
  27. | user | string | | run as another user, implemented by [procd](https://openwrt.org/docs/guide-developer/procd-init-scripts#service_parameters). |
  28. ### Limitation
  29. * As kcptun outputs all logs to stderr by default, you may receive lots of **LOG_ERR** level message when set syslog to 1.
  30. ## [Server options](#server-options)
  31. | Name | Type | Option | Description |
  32. | ---- | ---- | ------ | ----------- |
  33. | listen | port number | --listen, -l | kcp server listen port (default: ":29900") |
  34. | target | host | --target, -t | target server address (default: "127.0.0.1:12948") |
  35. | target_port | port number | --target, -t | target server port (default: "127.0.0.1:12948") |
  36. | pprof | boolean | --pprof | start profiling server on :6060 |
  37. ## [Client options](#client-options)
  38. | Name | Type | Option | Description |
  39. | ---- | ---- | ------ | ----------- |
  40. | bind_address | IP address | --localaddr, -l | local listen address (default: ":12948") |
  41. | local_port | port number | --localaddr, -l | local listen port (default: ":12948") |
  42. | server | host | --remoteaddr, -r | kcp server address (default: "vps:29900") |
  43. | server_port | port number | --remoteaddr, -r | kcp server port (default: "vps:29900") |
  44. | conn | integer | --conn | set num of UDP connections to server (default: 1) |
  45. | autoexpire | integer | --autoexpire | set auto expiration time(in seconds) for a single UDP connection, 0 to disable (default: 0) |
  46. | scavengettl | integer | --scavengettl | set how long an expired connection can live(in sec), -1 to disable (default: 600) |