很长时间没有更新博客了,今天偶然发现simple-obfs已经废弃了,取而代之的是v2ray-plugin,于是我决定尝鲜一下。

服务端部署

部署环境:CentOS 7.6 x64

安装Shadowsocks-libev

这个之前博文说过,就不重复了。

安装v2ray-plugin

我懒得编译,直接下载已经编译好的了,解压到/usr/local/bin/下。

获取SSL证书

我使用的是Let’s Encrypt的免费证书,执行命令之前记得先将域名的A记录解析到服务器IP上,并且开放80和443端口。

wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
./certbot-auto certonly

成功之后会有/etc/letsencrypt/live/域名/fullchain.pem/etc/letsencrypt/live/域名/privkey.pem两个文件。

修改配置文件

默认配置文件在/etc/shadowsocks-libev/config.json,如下文所示,在最后加上pluginplugin_opts,把域名换成自己的就行。这里采用的是Shadowsocks over websocket (HTTPS),其它的可以自己参考GitHub上的介绍。

{
    "server":"0.0.0.0",
    "server_port":443,
    "local_port":1080,
    "password":"password",
    "timeout":300,
    "method":"aes-256-gcm",
    "plugin":"v2ray-plugin",
    "plugin_opts":"server;tls;cert=/etc/letsencrypt/live/域名/fullchain.pem;key=/etc/letsencrypt/live/域名/privkey.pem;host=域名;loglevel=none"
}

最后执行ss-server -c /etc/shadowsocks-libev/config.json -f /run/shadowsocks.pid即可。

客户端设置

先安装对应平台的Shadowsocks客户端。

Windows

直接下载已经编译好的v2ray-plugin的windows版,解压后命名为v2ray-plugin.exeShadowsocks.exe放在同一文件夹下。
在Shadowsocks的服务器设置中,插件程序填v2ray-plugin,插件选项填tls;host=域名。域名要和服务端设置的一致。

Android

安装v2ray-plugin-android,打开Shadowsocks编辑服务器,在最下面的插件中选择v2ray,配置Transport mode为websocket-tls,Hostname为服务端设置的域名即可。

Ubuntu

直接下载已经编译好的v2ray-plugin,解压到/usr/local/bin/下。
编辑配置文件/etc/shadowsocks-libev/config.json,如下文所示,在最后加上pluginplugin_opts,域名要和服务端设置的一致。

{
    "server":"域名",
    "server_port":443,
    "local_port":1080,
    "password":"password",
    "timeout":300,
    "method":"aes-256-gcm",
    "plugin":"v2ray-plugin",
    "plugin_opts":"tls;host=域名;loglevel=none"
}

最后执行ss-local -c /etc/shadowsocks-libev/config.json即可。

优势

你甚至可以把SS服务器放在CDN后面,免费的CDN有Cloudflare
GFW就拿你没办法了哈哈。