跳转至

sing-box 1.14.0 中的更改

http_client
download_detour

sing-box 1.10.0 中的更改

type: inline

规则集

自 sing-box 1.8.0 起

结构

自 sing-box 1.10.0 起

{
  "type": "inline", // 可选
  "tag": "",
  "rules": []
}
{
  "type": "local",
  "tag": "",
  "format": "source", // or binary
  "path": ""
}

远程规则集将被缓存如果 experimental.cache_file.enabled 已启用。

{
  "type": "remote",
  "tag": "",
  "format": "source", // or binary
  "url": "",
  "http_client": "", // 或 {}
  "update_interval": "",

  // 废弃的

  "download_detour": ""
}

字段

type

必填

规则集类型, localremote

tag

必填

规则集的标签。

内联字段

自 sing-box 1.10.0 起

rules

必填

一组 无头规则.

本地或远程字段

format

必填

规则集格式, sourcebinary

pathurl 使用 jsonsrs 作为扩展名时可选。

本地字段

path

必填

自 sing-box 1.10.0 起,文件更改时将自动重新加载。

规则集的文件路径。

远程字段

url

必填

规则集的下载 URL。

http_client

自 sing-box 1.14.0 起

用于下载规则集的 HTTP 客户端。

参阅 HTTP 客户端字段 了解详情。

如果为空,将使用默认传输。

update_interval

规则集的更新间隔。

默认使用 1d

download_detour

已在 sing-box 1.14.0 废弃

download_detour 已在 sing-box 1.14.0 废弃且将在 sing-box 1.16.0 中被移除,请使用 http_client 代替。

用于下载规则集的出站的标签。