更新

<aside> 💡 刚刚,ShadowTLS V2 协议 在 sing-box 开发分支更新啦!**这次更新有望解决主动探测问题!**离好用又近了一步

</aside>

特点

服务端搭建

本 Docker 重度患者决定全程容器化了,直接宿主机配置也大同小异

因为 Sing-box 没有提供官方的镜像,但有提供 Dockerfile, 所以先提前自己编译一下

以下服务器搭建步骤在 Oracle ARM A1 下测试通过

编译镜像

# Git clone the repo
# Switch to dev-next
git clone <https://github.com/SagerNet/sing-box.git> -b dev-next

# Build docker image
cd sing-box
docker build . -t sing-box:dev-next

配置

首先,先生成一个 Shadowsocks 2022 的密钥

本例中采用 2022-blake3-aes-128-gcm 作为加密方式,因此采用 16 位长的密钥 (参考)

openssl rand -base64 16

然后我直接贴配置

{
    "log": {
        "level": "info",
        "timestamp": true
    },
    "dns": {
        "servers": [
            {
                "tag": "google",
                "address": "tls://dns.google",
                "address_resolver": "local",
                "address_strategy": "prefer_ipv4",
                "strategy": "prefer_ipv4",
                "detour": "direct"
            }
        ]
    },
    "inbounds": [
        {
            "type": "shadowtls",
            "tag": "shadowtls-in",
            "listen": "::",
            "listen_port": 440,
						"version": 2,
					  "password": "superidoldexiaorong",
            "handshake": {
                "server": "download-cdn.jetbrains.com",  // 可以选择一些大流量的域名,比如说 CDN 之类
                "server_port": 443
            },
            "detour": "shadowsocks-in"
        },
        {
            "type": "shadowsocks",
            "tag": "shadowsocks-in",
            "listen": "127.0.0.1",
            "method": "2022-blake3-aes-128-gcm",
            "password": "CqZnJWegiRnnmADvuh5hzg==" // 务必换成自己的密钥
        }
    ],
    "outbounds": [
        {
            "type": "direct",
            "tag": "direct"
        }
    ],
    "route": {},
    "experimental": {}
}

然后

docker run -d --name=singbox-server \\
	--network=host \\
	-v $(pwd):/etc/sing-box \\
	sing-box:dev-next run -D /etc/sing-box