ShadowsocksR — sing-box
sing-box 实现 SSR 客户端侧。不支持入站 —— 服务端请使用 SSR 专用 实现(ShadowsocksR-libev 或其分支)。
出站
type: "shadowsocksr":
| 字段 | 类型 | 默认值 | 允许值 | 描述 |
|---|---|---|---|---|
method | string | (required) | aes-256-cfb | aes-128-ctr | chacha20-ietf | rc4-md5 | <other SSR ciphers> | SSR 加密算法。可接受集合是历史 SSR 加密目录 —— RC4、AES-CFB、AES-CTR、ChaCha20 等。现代 AEAD 加密属于常规 Shadowsocks 出站。 |
password | string | (required) | <string> | 服务端密码。 |
obfs | string | (unset) | plain | http_simple | http_post | random_head | tls1.2_ticket_auth | 混淆插件。`plain` 无混淆;`http_simple` 与 `http_post` 发出伪造 HTTP 请求;`tls1.2_ticket_auth` 模拟 TLS 复用。 |
obfs_param | string | (unset) | <string> | 插件参数。对 HTTP obfs 而言是 Host 头。 |
protocol | string | origin | origin | auth_aes128_md5 | auth_aes128_sha1 | auth_sha1_v4 | auth_chain_a | auth_chain_b | 协议层插件。`origin` 无插件;`auth_*` 家族每包带鉴权。 |
protocol_param | string | (unset) | <string> | 协议层参数。许多插件用作用户数或限速提示。 |
network | NetworkList | (tcp+udp) | tcp | udp | | 限定为仅 TCP 或仅 UDP。 |
源码: option/shadowsocksr.go:3-13 · 锚定版本 v1.13.11 (553cfa1)
内嵌 DialerOptions 与 ServerOptions。
示例
带 HTTP obfs 的纯 SSR:
json
{
"outbounds": [
{
"type": "shadowsocksr",
"tag": "ssr-out",
"server": "example.com",
"server_port": 443,
"method": "aes-256-cfb",
"password": "<password>",
"obfs": "http_simple",
"obfs_param": "www.bing.com",
"protocol": "auth_chain_a",
"protocol_param": "32"
}
]
}TLS-ticket-auth obfs:
json
{
"outbounds": [
{
"type": "shadowsocksr",
"server": "example.com",
"server_port": 443,
"method": "chacha20-ietf",
"password": "<password>",
"obfs": "tls1.2_ticket_auth",
"obfs_param": "www.bing.com",
"protocol": "auth_chain_b"
}
]
}说明
- 仅客户端。若要跑 SSR 服务端,需要专用 SSR 守护进程 —— sing-box 的
shadowsocksr出站没有同名的入站类型与之配对。 method、obfs、protocol接受的字符串是历史 SSR 目录。「现代」 Shadowsocks 加密(AEAD、2022-blake3-*)应放在 Shadowsocks 出站。auth_chain_*协议插件是今天仍在活跃使用的;旧的auth_aes128_*与auth_sha1_v4变体因 2018 年发现的重放攻击类 漏洞已不安全。
跨内核说明
- Xray-core 不支持 SSR。参见 SSR — Xray-core。
- mihomo 使用
cipher(而非method)以及参数字段的 kebab-case 形式(obfs-param、protocol-param)。参见 SSR — mihomo。
源码: option/shadowsocksr.go:3-13 · v1.13.11 (553cfa1)
