技术生活

shadowsocks-libev配置v2ray-plugin

一、安装shadowsocks-libev.

sudo apt update
sudo apt install shadowsocks-libev

二、安装v2ray-plugin.

1.安装go

cd ~ && curl -O https://dl.google.com/go/go1.12.5.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.12.5.linux-amd64.tar.gz
export GOPATH=$HOME/work
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
go version

2.安装v2ray-plugin.

git clone https://github.com/shadowsocks/v2ray-plugin.git
cd v2ray-plugin
go build
cp v2ray-plugin /usr/bin/v2ray-plugin

三、配置shadowsocks-libev和v2ray-plugin.

nano /etc/shadowsocks-libev/config.json
...
{
    "server":"0.0.0.0",
    "server_port": your_ss_server_port,
    "nameserver":"8.8.8.8",
    "mode":"tcp_only",
    "password":"your_key",
    "timeout":60,
    "method":"chacha20-ietf-poly1305",
    "reuse_port":true,
    "no_delay":true,
    "plugin":"v2ray-plugin",
    "plugin_opts":"logvel=none;server;tls;fast-open;host=your_domain;cert=/your_ssl_path/fullchain.pem;key=/your_ssl/privkey.pem;"
}
...

nano /lib/systemd/system/shadowsocks-libev.service
...
[Unit]
Description=Shadowsocks-libev Default Server Service
Documentation=man:shadowsocks-libev(8)
After=network.target

[Service]
Type=simple
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE
EnvironmentFile=/etc/default/shadowsocks-libev
LimitNOFILE=32768
ExecStart=/usr/bin/ss-server -c $CONFFILE $DAEMON_ARGS
[Install]
WantedBy=multi-user.target
...

四、服务端运行

systemctl daemon-reload
systemctl restart shadowsocks-libev

五、客户端运行

nohup ss-local -s your_domain -p your_ss_server_port -l your_local_port -k your_key -m chacha20-ietf-poly1305 --plugin v2ray-plugin --plugin-opts "tls;host=your_domain" &

六、参考与引用

1.https://github.com/shadowsocks/v2ray-plugin

2.https://github.com/shadowsocks/shadowsocks-libev

3.https://gist.github.com/shuanghua/c9c448f9bd12ebbfd720b34f4e1dd5c6

4.https://medium.com/@caorun/%E5%AE%89%E8%A3%85shadowsocks-libev%E6%8F%92%E4%BB%B6v2ray-plugin-dfd10ecc0085

发表评论

电子邮件地址不会被公开。 必填项已用*标注