Skip to content

协议探测 ​

action: sniff 读取流的最初字节或数据报,之后的规则可以匹配 protocol 和嗅探得到的域名。

yaml
outbounds:
  direct:
    type: direct
  proxy:
    type: socks
    server: proxy.example:1080

route:
  rules:
    - {action: sniff, timeout: 1s, sniffer: [tls, http, quic]}
    - {protocol: tls, domain_suffix: [example.com], outbound: proxy}
    - {protocol: http, outbound: direct}
  final: direct

dns:
  servers:
    default: {type: udp, address: 127.0.0.1:53}
  final: default

字段 ​

sniffer ​

  • 类型:字符串或数组。
  • 默认:空,表示所有嗅探器。
  • 取值:http、tls、quic、dns、stun、dtls、ssh、bittorrent、ntp、rdp。

timeout ​

  • 类型:时长。
  • 默认:300ms。
  • 行为:等待足够首字节的时间。

说明 ​

流嗅探 TLS、HTTP、DNS、BitTorrent、SSH 和 RDP;数据报嗅探 DNS、QUIC、STUN、BitTorrent、DTLS 和 NTP。嗅探成功后写入协议,找到名字时也写入目的地域名。嗅探前作出的路由判断不会重新考虑。

相关 ​

页面历史

开发者设计、代码地图和验证记录保留在仓库 manual/。