Skip to content

ShadowsocksR — mihomo

mihomo 提供 ShadowsocksR 客户端出站。仅客户端 —— 不存在 SSR 入站 类型。

出站

proxies:type: ssr 条目。内嵌 BasicOption

字段类型默认值允许值描述
namestring(required)<string>唯一的代理名。
serverstring(required)<host>上游服务器主机名或 IP。
portint(required)<port>上游服务器端口。
passwordstring(required)<string>服务端密码。
cipherstring(required)aes-256-cfb | aes-128-ctr | chacha20-ietf | rc4-md5 | <other SSR ciphers>SSR 加密算法。mihomo 中对应其他内核的 `method`。
obfsstring(required)plain | http_simple | http_post | random_head | tls1.2_ticket_auth混淆插件。
obfs-paramstring(unset)<string>混淆参数(HTTP 风格 obfs 的 Host 头)。
protocolstring(required)origin | auth_aes128_md5 | auth_aes128_sha1 | auth_sha1_v4 | auth_chain_a | auth_chain_b协议层插件。
protocol-paramstring(unset)<string>协议层参数。
udpboolfalsetrue | false允许 UDP 包经此出站转发。

源码: adapter/outbound/shadowsocksr.go:28-40 · 锚定版本 v1.19.27 (5184081)

示例

带链式鉴权的纯 SSR:

yaml
proxies:
  - name: ssr-server
    type: ssr
    server: example.com
    port: 443
    password: <password>
    cipher: aes-256-cfb
    obfs: http_simple
    obfs-param: www.bing.com
    protocol: auth_chain_a
    protocol-param: "32"
    udp: true

TLS-ticket obfs:

yaml
proxies:
  - name: ssr-tls
    type: ssr
    server: example.com
    port: 443
    password: <password>
    cipher: chacha20-ietf
    obfs: tls1.2_ticket_auth
    obfs-param: www.bing.com
    protocol: auth_chain_b
    udp: true

说明

  • SSR 已属于 遗留 协议。新部署请优先选用 Shadowsocks AEAD / 2022 系列加密 —— 前向保密更好,且没有已知 DPI 识别特征。
  • YAML 中 obfsprotocol 是必填字段 —— 即便希望走纯直通行为 也要显式设为 plainorigin
  • UDP 转发(udp: true)与原始 ShadowsocksR 参考实现互通,但 与丢弃 「UDP + 协议插件」组合的 libev 分支互通。

跨内核说明

  • Xray-core 不支持 SSR。参见 SSR — Xray-core
  • sing-box 使用 method(而非 cipher),参数字段为 snake_case(obfs_paramprotocol_param)。参见 SSR — sing-box

源码: adapter/outbound/shadowsocksr.go:28-40 · v1.19.27 (5184081)

由 Argsment 出品的 Core Tutorial