KCP¶
KCP is a data channel type in GOST. The implementation of KCP depends on the xtaci/kcp-go library.
Usage¶
Configuration¶
GOST has a built-in set of default KCP configuration items, and the default values are consistent with xtaci/kcptun.
You can specify the configuration directly through kcp.config
option. You can also specify an external configuration file through kcp.configFile
option. The configuration file is in JSON format:
{
"key": "it's a secrect",
"crypt": "aes",
"mode": "fast",
"mtu" : 1350,
"sndwnd": 1024,
"rcvwnd": 1024,
"datashard": 10,
"parityshard": 3,
"dscp": 0,
"nocomp": false,
"acknodelay": false,
"nodelay": 0,
"interval": 40,
"resend": 0,
"nc": 0,
"smuxver": 1,
"sockbuf": 4194304,
"keepalive": 10,
"snmplog": "",
"snmpperiod": 60,
"tcp": false
}
Some parameters can also be specified directly through options:
kcp.tcp
:- config.tcp
kcp.key
:- config.key
kcp.crypt
:- config.crypt
kcp.mode
:- config.mode
kcp.keepalive
:- config.keepalive
kcp.interval
:- config.interval
kcp.mtu
:- config.mtu
kcp.smuxver
:- config.smuxver
For a description of the parameters in the configuration file, see kcptun.
Proxy¶
KCP tunnel can be used in combination with various proxy protocols.
HTTP Over KCP¶
SOCKS5 Over KCP¶
Relay Over KCP¶
Port Forwarding¶
KCP tunnel can also be used as port forwarding.
Server
is equivalent to
By using port forwarding of the KCP tunnel, a KCP data channel is added to the Shadowsocks proxy service on port 8080.
At this time, port 8443 is equivalent to: