documentation: Merge route options to route actions

This commit is contained in:
世界 2024-11-11 17:24:15 +08:00
parent 8ef771652c
commit a1ded989b7
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4
8 changed files with 55 additions and 180 deletions

View File

@ -12,8 +12,6 @@ icon: material/new-box
{ {
"action": "route", // default "action": "route", // default
"server": "", "server": "",
// for compatibility
"disable_cache": false, "disable_cache": false,
"rewrite_ttl": 0, "rewrite_ttl": 0,
"client_subnet": null "client_subnet": null
@ -28,23 +26,6 @@ icon: material/new-box
Tag of target server. Tag of target server.
#### disable_cache/rewrite_ttl/client_subnet
!!! failure "Deprecated in sing-box 1.11.0"
Legacy route options is deprecated and will be removed in sing-box 1.12.0, check [Migration](/migration/#migrate-legacy-dns-route-options-to-rule-actions).
### route-options
```json
{
"action": "route-options",
"disable_cache": false,
"rewrite_ttl": null,
"client_subnet": null
}
```
#### disable_cache #### disable_cache
Disable cache and save cache in this query. Disable cache and save cache in this query.
@ -61,6 +42,19 @@ If value is an IP address instead of prefix, `/32` or `/128` will be appended au
Will overrides `dns.client_subnet` and `servers.[].client_subnet`. Will overrides `dns.client_subnet` and `servers.[].client_subnet`.
### route-options
```json
{
"action": "route-options",
"disable_cache": false,
"rewrite_ttl": null,
"client_subnet": null
}
```
`route-options` set options for routing.
### reject ### reject
```json ```json

View File

@ -28,24 +28,6 @@ icon: material/new-box
目标 DNS 服务器的标签。 目标 DNS 服务器的标签。
#### disable_cache/rewrite_ttl/client_subnet
!!! failure "自 sing-box 1.11.0 起"
旧的路由选项已弃用,且将在 sing-box 1.12.0 中移除,参阅 [迁移指南](/migration/#migrate-legacy-dns-route-options-to-rule-actions).
### route-options
```json
{
"action": "route-options",
"disable_cache": false,
"rewrite_ttl": null,
"client_subnet": null
}
```
#### disable_cache #### disable_cache
在此查询中禁用缓存。 在此查询中禁用缓存。
@ -62,6 +44,19 @@ icon: material/new-box
将覆盖 `dns.client_subnet``servers.[].client_subnet` 将覆盖 `dns.client_subnet``servers.[].client_subnet`
### route-options
```json
{
"action": "route-options",
"disable_cache": false,
"rewrite_ttl": null,
"client_subnet": null
}
```
`route-options` 为路由设置选项。
### reject ### reject
```json ```json

View File

@ -13,7 +13,9 @@ icon: material/new-box
```json ```json
{ {
"action": "route", // default "action": "route", // default
"outbound": "" "outbound": "",
"udp_disable_domain_unmapping": false,
"udp_connect": false
} }
``` ```
@ -25,18 +27,6 @@ icon: material/new-box
Tag of target outbound. Tag of target outbound.
### route-options
```json
{
"action": "route-options",
"udp_disable_domain_unmapping": false,
"udp_connect": false
}
```
`route-options` set options for routing.
#### udp_disable_domain_unmapping #### udp_disable_domain_unmapping
If enabled, for UDP proxy requests addressed to a domain, If enabled, for UDP proxy requests addressed to a domain,
@ -49,6 +39,18 @@ do not support receiving UDP packets with domain addresses, such as Surge.
If enabled, attempts to connect UDP connection to the destination instead of listen. If enabled, attempts to connect UDP connection to the destination instead of listen.
### route-options
```json
{
"action": "route-options",
"udp_disable_domain_unmapping": false,
"udp_connect": false
}
```
`route-options` set options for routing.
### reject ### reject
```json ```json

View File

@ -14,7 +14,8 @@ icon: material/new-box
{ {
"action": "route", // 默认 "action": "route", // 默认
"outbound": "", "outbound": "",
"udp_disable_domain_unmapping": false "udp_disable_domain_unmapping": false,
"udp_connect": false
} }
``` ```
@ -26,6 +27,16 @@ icon: material/new-box
目标出站的标签。 目标出站的标签。
#### udp_disable_domain_unmapping
如果启用,对于地址为域的 UDP 代理请求,将在响应中发送原始包地址而不是映射的域。
此选项用于兼容不支持接收带有域地址的 UDP 包的客户端,如 Surge。
#### udp_connect
如果启用,将尝试将 UDP 连接 connect 到目标而不是 listen。
### route-options ### route-options
```json ```json
@ -36,15 +47,7 @@ icon: material/new-box
} }
``` ```
#### udp_disable_domain_unmapping `route-options` 为路由设置选项。
如果启用,对于地址为域的 UDP 代理请求,将在响应中发送原始包地址而不是映射的域。
此选项用于兼容不支持接收带有域地址的 UDP 包的客户端,如 Surge。
#### udp_connect
如果启用,将尝试将 UDP 连接 connect 到目标而不是 listen。
### reject ### reject

View File

@ -22,14 +22,6 @@ check [Migration](../migration/#migrate-legacy-inbound-fields-to-rule-actions).
Old fields will be removed in sing-box 1.13.0. Old fields will be removed in sing-box 1.13.0.
#### Legacy DNS route options
Legacy DNS route options (`disable_cache`, `rewrite_ttl`, `client_subnet`) are deprecated
and can be replaced by rule actions,
check [Migration](../migration/#migrate-legacy-dns-route-options-to-rule-actions).
Old fields will be removed in sing-box 1.12.0.
## 1.10.0 ## 1.10.0
#### TUN address fields are merged #### TUN address fields are merged

View File

@ -20,13 +20,6 @@ icon: material/delete-alert
旧字段将在 sing-box 1.13.0 中被移除。 旧字段将在 sing-box 1.13.0 中被移除。
#### 旧的 DNS 路由参数
旧的 DNS 路由参数(`disable_cache`、`rewrite_ttl`、`client_subnet`)已废弃且可以通过规则动作替代,
参阅 [迁移指南](/migration/#migrate-legacy-dns-route-options-to-rule-actions)。
旧字段将在 sing-box 1.12.0 中被移除。
## 1.10.0 ## 1.10.0
#### Match source 规则项已重命名 #### Match source 规则项已重命名

View File

@ -156,58 +156,6 @@ Inbound fields are deprecated and can be replaced by rule actions.
} }
``` ```
### Migrate legacy DNS route options to rule actions
Legacy DNS route options are deprecated and can be replaced by rule actions.
!!! info "References"
[DNS Rule](/configuration/dns/rule/) /
[DNS Rule Action](/configuration/dns/rule_action/)
=== ":material-card-remove: Deprecated"
```json
{
"dns": {
"rules": [
{
...,
"server": "local",
"disable_cache": true,
"rewrite_ttl": 600,
"client_subnet": "1.1.1.1/24"
}
]
}
}
```
=== ":material-card-multiple: New"
```json
{
"dns": {
"rules": [
{
...,
"action": "route-options",
"disable_cache": true,
"rewrite_ttl": 600,
"client_subnet": "1.1.1.1/24"
},
{
...,
"server": "local"
}
]
}
}
```
## 1.10.0 ## 1.10.0
### TUN address fields are merged ### TUN address fields are merged

View File

@ -156,58 +156,6 @@ icon: material/arrange-bring-forward
} }
``` ```
### 迁移旧的 DNS 路由选项到规则动作
旧的 DNS 路由选项已被弃用,且可以被规则动作替代。
!!! info "参考"
[DNS 规则](/zh/configuration/dns/rule/) /
[DNS 规则动作](/zh/configuration/dns/rule_action/)
=== ":material-card-remove: 弃用的"
```json
{
"dns": {
"rules": [
{
...,
"server": "local",
"disable_cache": true,
"rewrite_ttl": 600,
"client_subnet": "1.1.1.1/24"
}
]
}
}
```
=== ":material-card-multiple: 新的"
```json
{
"dns": {
"rules": [
{
...,
"action": "route-options",
"disable_cache": true,
"rewrite_ttl": 600,
"client_subnet": "1.1.1.1/24"
},
{
...,
"server": "local"
}
]
}
}
```
## 1.10.0 ## 1.10.0
### TUN 地址字段已合并 ### TUN 地址字段已合并