Published on

sing-box shadowTLS部署与使用

Authors

前置条件

  • docker

服务端

拉取镜像

docker pull ghcr.io/sagernet/sing-box:v1.1.7

创建配置文件

mkdir ~/sing-box
cd ~/sing-box
vim shatls.json

shatls.json

{
  "inbounds": [
    {
      "type": "shadowtls",
      "listen": "::",
      "listen_port": 4443,
      "version": 3,
      "users": [
        {
          "name": "用户名",
          "password": "密码"
        }
      ],
      "handshake": {
        "server": "apple.com",
        "server_port": 443
      },
      "detour": "shadowsocks-in"
    },
    {
      "type": "shadowsocks",
      "tag": "shadowsocks-in",
      "listen": "127.0.0.1",
      "network": "tcp",
      "method": "2022-blake3-aes-128-gcm",
      "password": "密码"
    }
  ]
}

启动sing-box容器

docker run --name sing-saTLS -p 5566:4443  -v /home/ubuntu/sing-box:/etc/sing-box -d ghcr.io/sagernet/sing-box:v1.1.7 run -c /etc/sing-box/shatls.json

客户端

使用nekobox gui 右键->手动输入配置 类型选择 自定义(sing-box) 填入 出站配置

配置1

    {
      "type": "shadowtls",
      "tag": "shadowtls-out",
      "server": "你的服务器",
      "server_port": 端口,
      "version": 3,
      "password": "密码",
      "tls": {
        "enabled": true,
        "server_name": "apple.com",
        "utls": {
          "enabled": true,
          "fingerprint": "chrome"
        }
      }
    }

再添加一个自定义配置

配置2

    {
      "type": "shadowsocks",
      "method": "2022-blake3-aes-128-gcm",
      "password": "你的密码",
"detour": "shadowtls-out",
      "multiplex": {
        "enabled": true,
        "max_connections": 4,
        "min_streams": 4
      }

    }

右键 添加 链式代理 按顺序选择配置1,配置2 然后点击确定即可