Skip to content

Commit 7b68cbb

Browse files
committed
Improve domain suffix match behavior
For historical reasons, sing-box's `domain_suffix` rule matches literal prefixes instead of the same as other projects. This change modifies the behavior of `domain_suffix`: If the rule value is prefixed with `.`, the behavior is unchanged, otherwise it matches `(domain|.+\.domain)` instead.
1 parent d4643f9 commit 7b68cbb

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

docs/migration.md

+7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ icon: material/arrange-bring-forward
88

99
This version is still under development, and the following migration guide may be changed in the future.
1010

11+
### `domain_suffix` behavior update
12+
13+
For historical reasons, sing-box's `domain_suffix` rule matches literal prefixes instead of the same as other projects.
14+
15+
sing-box 1.9.0 modifies the behavior of `domain_suffix`: If the rule value is prefixed with `.`,
16+
the behavior is unchanged, otherwise it matches `(domain|.+\.domain)` instead.
17+
1118
### `process_path` format update on Windows
1219

1320
The `process_path` rule of sing-box is inherited from Clash,

docs/migration.zh.md

+6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ icon: material/arrange-bring-forward
88

99
该版本仍在开发中,迁移指南可能将在未来更改。
1010

11+
### `domain_suffix` 行为更新
12+
13+
由于历史原因,sing-box 的 `domain_suffix` 规则匹配字面前缀,而不与其他项目相同。
14+
15+
sing-box 1.9.0 修改了 `domain_suffix` 的行为:如果规则值以 `.` 为前缀则行为不变,否则改为匹配 `(domain|.+\.domain)`
16+
1117
### 对 Windows 上 `process_path` 格式的更新
1218

1319
sing-box 的 `process_path` 规则继承自Clash,

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ require (
2626
github.com/sagernet/gvisor v0.0.0-20231209105102-8d27a30e436e
2727
github.com/sagernet/quic-go v0.40.1
2828
github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691
29-
github.com/sagernet/sing v0.3.0
29+
github.com/sagernet/sing v0.3.1-0.20240105061852-782bc05c5573
3030
github.com/sagernet/sing-dns v0.1.12
3131
github.com/sagernet/sing-mux v0.2.0
3232
github.com/sagernet/sing-quic v0.1.8

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ github.com/sagernet/quic-go v0.40.1/go.mod h1:CcKTpzTAISxrM4PA5M20/wYuz9Tj6Tx4Dw
109109
github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691 h1:5Th31OC6yj8byLGkEnIYp6grlXfo1QYUfiYFGjewIdc=
110110
github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691/go.mod h1:B8lp4WkQ1PwNnrVMM6KyuFR20pU8jYBD+A4EhJovEXU=
111111
github.com/sagernet/sing v0.2.18/go.mod h1:OL6k2F0vHmEzXz2KW19qQzu172FDgSbUSODylighuVo=
112-
github.com/sagernet/sing v0.3.0 h1:PIDVFZHnQAAYRL1UYqNM+0k5s8f/tb1lUW6UDcQiOc8=
113-
github.com/sagernet/sing v0.3.0/go.mod h1:9pfuAH6mZfgnz/YjP6xu5sxx882rfyjpcrTdUpd6w3g=
112+
github.com/sagernet/sing v0.3.1-0.20240105061852-782bc05c5573 h1:1wGN3eNanp8r+Y3bNBys3ZnAVF5gdtDoDwtosMZEbgA=
113+
github.com/sagernet/sing v0.3.1-0.20240105061852-782bc05c5573/go.mod h1:9pfuAH6mZfgnz/YjP6xu5sxx882rfyjpcrTdUpd6w3g=
114114
github.com/sagernet/sing-dns v0.1.12 h1:1HqZ+ln+Rezx/aJMStaS0d7oPeX2EobSV1NT537kyj4=
115115
github.com/sagernet/sing-dns v0.1.12/go.mod h1:rx/DTOisneQpCgNQ4jbFU/JNEtnz0lYcHXenlVzpjEU=
116116
github.com/sagernet/sing-mux v0.2.0 h1:4C+vd8HztJCWNYfufvgL49xaOoOHXty2+EAjnzN3IYo=

0 commit comments

Comments
 (0)