之前介绍过用kcptun来给搬瓦工等openvz架构的vps加速,不过搭建的过程稍微复杂。最近得知koolshare论坛clang大佬已经放出一键脚本,从SS到KCPTUN一键装好,真是贴心。以下内容就转载过来了:
脚本Github地址:https://github.com/clangcn/onekey-install-shell/tree/master/kcptun_for_ss_ssr
首先还是感谢,感谢 秋水逸冰 ,因为代码中很多都是借鉴了秋水大大的脚本,在此非常感谢大佬的付出。
下面开始简单的教程:
已测试过的平台:
CentOS 6 32/64bit
CentOS 7 32/64bit
Debian 6 32/64bit
Debian 7 32/64bit
Debian 8 32/64bit
Ubuntu 14 32/64bit
一、安装命令,这个命令都是在你的服务器上运行的
安装时间较长,网络不稳定的建议使用screen或者tmux进行安装,这两个东东请自行百度使用方法吧:
wget --no-check-certificate -O ./kcptun_for_ss_ssr-install.sh https://raw.githubusercontent.com/onekeyshell/kcptun_for_ss_ssr/master/kcptun_for_ss_ssr-install.sh
chmod700./kcptun_for_ss_ssr-install.sh
./kcptun_for_ss_ssr-install.sh install
二、安装步骤
1、运行脚本时会自动检测脚本是否有更新,如有更新会自动更新,然后需要再次运行脚本继续。
![](https://img.haomeiwen.com/i5027487/74da6664582f5c9d.png)
2、如果脚本是最新的,那么就会然你选择安装的内容:
![](https://img.haomeiwen.com/i5027487/8026643f4e89d32e.png)
![](https://img.haomeiwen.com/i5027487/9e4515e1f687e5ce.png)
![](https://img.haomeiwen.com/i5027487/e92201e9add967c3.png)
![](https://img.haomeiwen.com/i5027487/aa3e376c20a5c7ca.png)
三、卸载命令
./kcptun_for_ss_ssr-install.sh uninstall
复制代码
四、更新命令
./kcptun_for_ss_ssr-install.sh update
复制代码
原帖地址:http://koolshare.cn/thread-66315-1-1.html
客户端配置方法:
1、服务器安装完成后,在程序目录有一个客户端配置文件,需要下载到本地,客户端配置文件路径:
/usr/local/kcp-server/client.json
client.json范例:
{
"localaddr": ":1082",
"remoteaddr": "Server_IP:Server_Port",
"key": "Password",
"crypt": "salsa20",
"mode": "fast2",
"conn": 1,
"autoexpire": 60,
"mtu": 1350,
"sndwnd": 128,
"rcvwnd": 1024,
"datashard": 70,
"parityshard": 30,
"dscp": 46,
"nocomp": false,
"acknodelay": false,
"nodelay": 0,
"interval": 40,
"resend": 0,
"nc": 0,
"sockbuf": 4194304,
"keepalive": 10
}
复制代码
2、下载客户端配置文件后,到github上下载客户端程序(自行选择对应的客户端):
https://github.com/xtaci/kcptun/releases
kcptun-linux-amd64-20160906.tar.gz -----------> Linux 64位版本
kcptun-linux-386-20160906.tar.gz -----------> Linux 32位版本
kcptun-darwin-amd64-20160906.tar.gz ----------->MAC 64位版本
kcptun-darwin-386-20160906.tar.gz ----------->MAC 32位版本
kcptun-windows-amd64-20160906.tar.gz -----------> Windows 64位版本
kcptun-windows-386-20160906.tar.gz -----------> Windows 32位版本
kcptun-freebsd-amd64-20160906.tar.gz -----------> freebsd 64位版本
kcptun-freebsd-386-20160906.tar.gz -----------> freebsd 64位版本
kcptun-linux-arm-20160906.tar.gz -----------> ARM 版本
3、Linux、Mac、路由器上下载客户端后需要设置运行权
Linux:
chmod +x client_linux_*
复制代码
MAC:
chmod +x client_darwin_amd64
复制代码
路由器:
chmod +x kcp_router
复制代码
4、运行命令
Linux(32位):
./client_linux_386 -c client.json
复制代码
Linux(64位):
./client_linux_amd64 -c client.json
复制代码
MAC:
./client_darwin_amd64 -c client.json
复制代码
Windows(32位)
client_windows_386.exe -c client.json
复制代码
Windows(64位)
client_windows_amd64.exe -c client.json
复制代码
网友评论