shadowsocks 服务端安装指南
官方地址:
旧地址,不再更新:
本文基于Ubuntu。
install
|
|
Configuration
官方文档说配置文件在这里:
Edit your config.json file. By default, it’s located in /usr/local/etc/shadowsocks-libev.
但我的不是。
编辑/etc/shadowsocks-libev/config.json
|
|
mode有三种:tcp_only,udp_only,tcp_and_udp。
“server”:“0.0.0.0” //只使用ipv4
“server”:["::0",“0.0.0.0”] //使用ipv6和ipv4
server-port: 这个端口我之前用的443,因为公司网络只给了80和443出口。但是用443的时候很慢或者根本翻不出去,v2RayN日志如下:
app/proxyman/outbound: failed to process outbound traffic > proxy/shadowsocks: failed to find an available destination > common/retry: [dial tcp x.x.x.x:443: i/o timeout dial tcp x.x.x.x:443: operation was canceled] > common/retry: all retry attempts failed
换成别的端口如8888就可以了。80没试。
默认的
"server":["::1", "127.0.0.1"]
不行。删掉了
"local_port":1080
,服务端不需要。
加速
Using TCP BBR1
|
|
开机启动
|
|
官方文档做法:
To enable shadowsocks-libev, add the following rc variable to your
/etc/rc.conf
file:
1
shadowsocks_libev_enable="YES"
Run
Start the Shadowsocks server:
|
|
提示
shadowsocks的服务器在v2rayNG app上无法使用,需使用Shadowsocks app。但是PC上的v2rayN可以使用ss服务器。
Using TCP BBR
TCP BBR is a TCP congestion control algorithm developed by Google and its been reported to improve performance on certain networks. You can enable it by adding the following to lines to your system configuration file.
1
sudo nano /etc/sysctl.conf
1 2
net.core.default_qdisc=fq net.ipv4.tcp_congestion_control=bbr
Then save the file and reload the settings.
1
sudo sysctl -p
Check the changes by running the next command.
1
sudo sysctl net.ipv4.tcp_congestion_control
If the output is as follows the setting was applied successfully.
1
net.ipv4.tcp_congestion_control = bbr
These optimisations should help alleviate any possible performance issues. ↩︎