ss-server服务器流量优化

今天偶然发现 shadowsocks 有一个 --acl 参数,能够定义 ss-local 和 ss-server 的流量规则。只有 libev 版本有这个参数,Python 版本没有。

使用方法:

wget https://mume.red/etc/server_block_chn.acl

ss-server --acl server_block_chn.acl -c config.json

ss-libev 的官方 repo 上也有一份 server_block_chn.acl,但是上面有 3800+ 条规则,我用了之后服务器 CPU 占用率很快就上去了。我对规则做了合并精简,上面提供的 acl 只有 300+ 条规则,CPU 占用率跟 Python 版本持平。

ss-local 也可以设置类似的规则做分流,这样国内的流量就不用通过代理服务器走一轮,可以降低国内访问的延迟。做法类似,这里就不细说啦。准备把这个规则内置到寒梅 app 里,一劳永逸解决朋友圈图片无法加载的问题。寒梅前几天成功回归苹果商店,如果你恰好有外区的 Apple ID,可以点击阅读原文🔗下载安装。

文章长度不够,文档来凑:

# All IPs listed here will be blocked while the ss-server try to outbound.# Only IP is allowed, *NOT* domain name.## The IPs bellow are all IPs in CHN. Itll block ss-server to access all# CHN hosts by command# `ss-server -s:: -p 8388 -k--acl acl/server_block_chn.acl`

赞赏还不没能开通,继续贴二维码