Shadowsocks and v2ray server tutorial

基于shadowsocks+v2ray的服务端搭建教程

shadowsocks选择的是基于C语言的shadowsocks-libev分支版本,v2ray作为其插件
Github安装文档

  1. 参考Github文档安装shadowsocks-libev;
  2. 安装v2ray-plugin插件;
    1. 根据操作系统下载最新版v2ray-plugin插件程序包;
    2. 解压程序包并将解压出的可执行文件v2ray-plugin_linux_*移动到/usr/local/bin目录;
  3. 配置文件中plugin字段填入插件程序名v2ray-plugin_linux_*;
安装BBR加速

参考秋水逸冰一键安装最新内核并开启BBR脚本

配置文件示例
单端口配置config.json
{
    "server":"0.0.0.0",
    "server_port":8000,
    "local_port":1080,
    "mode":"tcp_and_udp",
    "password":"password",
    "timeout":300,
    "fast_open":true,
    "method":"chacha20-ietf-poly1305",
    "plugin":"v2ray-plugin",
    "plugin_opts":"server"
}

多端口配置manager.json
{
    "server":"0.0.0.0",
    "local_port":1080,
    "mode":"tcp_and_udp",
    "port_password":{
        "8000":"password0",
        "8001":"password1",
        "8002":"password2"
    },
    "timeout":300,
    "fast_open":true,
    "method":"chacha20-ietf-poly1305",
    "plugin":"v2ray-plugin",
    "plugin_opts":"server"
}

相关命令
  1. nohup ss-server -c /etc/shadowsocks-libev/config.json >~/shadowsocks.log 2>&1 &
  2. nohup ss-manager -c /etc/shadowsocks-libev/manager.json >~/shadowsocks.log 2>&1 &
  3. pkill ss-server / pkill v2ray-plugin / killall ss-server /killall v2ray-plugin