Guide for ShadowsocksX-NG with kcptun plugin configuration

There's little information on the internet about configuring the Kcptun plugin for ShadowsocksX-NG. It is necessary to write a blog to record the process that how I configured it, as it is not only helpful for myself later, and it could help the others who need it. Let's start.

  1. Download the latest ShadowsocksX-NG release and install it on your macOS (It is v1.9.3 when I wrote this article. If you meet issues with newer version, maybe it is worth to try the v1.9.3 release), it is the easiest step. You won't meet any problems at this stage.

  2. The following are samples for shadowsocks server configuration and Kcptun server configuration:

Sample for the shadowsocks-libev config.json

{
    "server":"0.0.0.0",
    "server_port":8964,
    "local_port":1080,
    "password":"your-secure-password",
    "timeout":60,
    "method":"chacha20-ietf-poly1305"
}

Sample for the Kcptun server configuration 

./server_linux_amd64 -t 127.0.0.1:8964 -l :28964 -mode fast3 -key chrd5 -sockbuf 16777217 -nocomp -dscp 46 -crypt none

Your configuration may be different from the samples, it doesn't matter.

  1. The configuration details
Address: your-server-ip-or-domain
Port: 28964
Encryption: chacha20-ietf-poly1305
Password: your-secure-password
Plugin: kcptun
Plugin Opts: key=chrd5;crypt=none;mode=fast3;sockbuf=16777217;nocomp;dscp=46
Remarks: AnythingYouLike

What you need to pay attention to in the upper configuration:

  1. The Port should be the Port that your Kcptun server is listening to, not the port that your Shadowsocks server is listening.
  2. For the Plugin Opts, you don't need to specify any IP or Port parameters.
  3. You don't need to download the Kcptun plugin by yourself, because it is builtin in latest release.

That's all.