From 6affde303e9693c0e41eee9a05e30b1824134d8b Mon Sep 17 00:00:00 2001 From: CloseHandle <88403145+closehandle@users.noreply.github.com> Date: Sat, 23 Nov 2024 22:26:28 +0800 Subject: [PATCH] documentation: sniff override destination --- docs/configuration/route/rule_action.md | 9 ++++++++- docs/configuration/route/rule_action.zh.md | 9 ++++++++- docs/configuration/shared/listen.md | 2 +- docs/configuration/shared/listen.zh.md | 2 +- docs/migration.md | 4 +++- docs/migration.zh.md | 4 +++- 6 files changed, 24 insertions(+), 6 deletions(-) diff --git a/docs/configuration/route/rule_action.md b/docs/configuration/route/rule_action.md index 63e2b00b..fc8d4651 100644 --- a/docs/configuration/route/rule_action.md +++ b/docs/configuration/route/rule_action.md @@ -131,7 +131,8 @@ Not available when `method` is set to drop. { "action": "sniff", "sniffer": [], - "timeout": "" + "timeout": "", + "override_destination": false } ``` @@ -153,6 +154,12 @@ Timeout for sniffing. `300ms` is used by default. +### override_destination + +Override the connection destination address with the sniffed domain. + +If the domain name is invalid (like tor), this will not work. + ### resolve ```json diff --git a/docs/configuration/route/rule_action.zh.md b/docs/configuration/route/rule_action.zh.md index 7959fced..b610795f 100644 --- a/docs/configuration/route/rule_action.zh.md +++ b/docs/configuration/route/rule_action.zh.md @@ -129,7 +129,8 @@ icon: material/new-box { "action": "sniff", "sniffer": [], - "timeout": "" + "timeout": "", + "override_destination": false } ``` @@ -151,6 +152,12 @@ icon: material/new-box 默认使用 300ms。 +#### override_destination + +用探测出的域名覆盖连接目标地址。 + +如果域名无效(如 Tor),将不生效。 + ### resolve ```json diff --git a/docs/configuration/shared/listen.md b/docs/configuration/shared/listen.md index 3e1b000f..c9487ce6 100644 --- a/docs/configuration/shared/listen.md +++ b/docs/configuration/shared/listen.md @@ -92,7 +92,7 @@ See [Protocol Sniff](/configuration/route/sniff/) for details. !!! failure "Deprecated in sing-box 1.11.0" - Inbound fields are deprecated and will be removed in sing-box 1.13.0. + Inbound fields are deprecated and will be removed in sing-box 1.13.0, check [Migration](/migration/#migrate-legacy-inbound-fields-to-rule-actions). Override the connection destination address with the sniffed domain. diff --git a/docs/configuration/shared/listen.zh.md b/docs/configuration/shared/listen.zh.md index 4f8ca9d6..17d2f141 100644 --- a/docs/configuration/shared/listen.zh.md +++ b/docs/configuration/shared/listen.zh.md @@ -93,7 +93,7 @@ UDP NAT 过期时间。 !!! failure "已在 sing-box 1.11.0 废弃" - 入站字段已废弃且将在 sing-box 1.12.0 中被移除。 + 入站字段已废弃且将在 sing-box 1.12.0 中被移除,参阅 [迁移指南](/migration/#migrate-legacy-inbound-fields-to-rule-actions). 用探测出的域名覆盖连接目标地址。 diff --git a/docs/migration.md b/docs/migration.md index c8b876f7..83a2d83c 100644 --- a/docs/migration.md +++ b/docs/migration.md @@ -123,6 +123,7 @@ Inbound fields are deprecated and can be replaced by rule actions. "type": "mixed", "sniff": true, "sniff_timeout": "1s", + "sniff_override_destination": true, "domain_strategy": "prefer_ipv4" } ] @@ -149,7 +150,8 @@ Inbound fields are deprecated and can be replaced by rule actions. { "inbound": "in", "action": "sniff", - "timeout": "1s" + "timeout": "1s", + "override_destination": true } ] } diff --git a/docs/migration.zh.md b/docs/migration.zh.md index 32be5604..bcaa3663 100644 --- a/docs/migration.zh.md +++ b/docs/migration.zh.md @@ -123,6 +123,7 @@ icon: material/arrange-bring-forward "type": "mixed", "sniff": true, "sniff_timeout": "1s", + "sniff_override_destination": true, "domain_strategy": "prefer_ipv4" } ] @@ -149,7 +150,8 @@ icon: material/arrange-bring-forward { "inbound": "in", "action": "sniff", - "timeout": "1s" + "timeout": "1s", + "override_destination": true } ] }