Shadowsocks-libev+plugin

Shadowsocks-libev


此版本为C++版本(python同理)。环境Debian9

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

sudo apt update
sudo apt install shadowsocks-libev

# Edit the configuration file
sudo vim /etc/shadowsocks-libev/config.json

# Edit the default configuration for debian
sudo vim /etc/default/shadowsocks-libev

# Start the service
sudo /etc/init.d/shadowsocks-libev start # for sysvinit, or
sudo systemctl start shadowsocks-libev # for systemd
# Boot from boot
systemctl enable shadowsocks

vim /etc/shadowsocks-libev/config.json

Quick Guide

1
2
3
4
5
6
7
8
9
10
11
12
13

{
"server":["[::0]","0.0.0.0"],
"server_port":8388,
"local_address": "127.0.0.1",
"local_port":1080,
"password":"PASSWORD",
"timeout":300,
"method":"aes-256-gcm",
"fast_open":true,
"mode":"tcp_and_udp"

}

Advanced

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

{
"server":["[::0]","0.0.0.0"],
"server_port":443,
"password":"PASSWORD",
"timeout":300,
"user":"nobody",
"method":"aes-256-gcm",
"nameserver": "8.8.8.8",
"fast_open":true,
"reuse_port":true,
"no_delay":true,
"mode":"tcp_and_udp"
"plugin":"v2ray-plugin", //或者v2ray-plugin绝对路径
"plugin_opts":"server;tls;host=xxxx .com;cert=/root/.acme.sh/xxxx.com/fullchain.cer;key=/root/.acme.sh/xxxx.com/xxxx.com.key"
}

libmbedtls and libsodium


提供部分加密需求chacha20类

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

# Installation of basic build dependencies
## Debian / Ubuntu
sudo apt-get install --no-install-recommends gettext build-essential autoconf libtool libpcre3-dev asciidoc xmlto libev-dev libc-ares-dev automake libmbedtls-dev libsodium-dev
## CentOS / Fedora / RHEL
sudo yum install gettext gcc autoconf libtool automake make asciidoc xmlto c-ares-devel libev-devel
## Arch
sudo pacman -S gettext gcc autoconf libtool automake make asciidoc xmlto c-ares libev

# Installation of libsodium
export LIBSODIUM_VER=1.0.16
wget https://download.libsodium.org/libsodium/releases/libsodium-$LIBSODIUM_VER.tar.gz
tar xvf libsodium-$LIBSODIUM_VER.tar.gz
pushd libsodium-$LIBSODIUM_VER
./configure --prefix=/usr && make
sudo make install
popd
sudo ldconfig

# Installation of MbedTLS
export MBEDTLS_VER=2.6.0
wget https://tls.mbed.org/download/mbedtls-$MBEDTLS_VER-gpl.tgz
tar xvf mbedtls-$MBEDTLS_VER-gpl.tgz
pushd mbedtls-$MBEDTLS_VER
make SHARED=1 CFLAGS=-fPIC
sudo make DESTDIR=/usr install
popd
sudo ldconfig

# Start building
./autogen.sh && ./configure && make
sudo make install

v2ray-plugin

simple-obfs Deprecated. (弃用)

See command line args for advanced usages.

  • Shadowsocks over websocket (HTTP)

On your server

ss-server -c config.json -p 80 --plugin v2ray-plugin --plugin-opts "server"

On your client

ss-local -c config.json -p 80 --plugin v2ray-plugin
  • Shadowsocks over websocket (HTTPS)

On your server

ss-server -c config.json -p 443 --plugin v2ray-plugin --plugin-opts "server;tls;host=mydomain.me"

On your client

ss-local -c config.json -p 443 --plugin v2ray-plugin --plugin-opts "tls;host=mydomain.me"
  • Shadowsocks over quic

On your server

ss-server -c config.json -p 443 --plugin v2ray-plugin --plugin-opts "server;mode=quic;host=mydomain.me"

On your client

ss-local -c config.json -p 443 --plugin v2ray-plugin --plugin-opts "mode=quic;host=mydomain.me"
  • Issue a cert for TLS and QUIC

v2ray-plugin will look for TLS certificates signed by acme.sh by default. Here’s some sample commands for issuing a certificate using CloudFlare. You can find commands for issuing certificates for other DNS providers at acme.sh.

curl https://get.acme.sh | sh
~/.acme.sh/acme.sh --issue --dns dns_cf -d mydomain.me

Alternatively, you can specify path to your certificates using option cert and key.
#

最后

客户端可以直接原有的 shadowsocks-win 客户端,放一个 v2ray-plugin.exe 文件到 Shadowsocks.exe 同目录下即可。Android 可以下到 v2ray plugin,是给ss客户端的一个插件,用起来也很直白。v2ray-plugin 已经有编译好的文件直接在 v2ray-pluginreleases 页面下下来即可,注意tar.gz解压后的二进制文件要改成正确的名称。


参阅

Shadowsocks (简体中文))