-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
62ac3c8
commit f91a90c
Showing
4 changed files
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f91a90c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对
domain_suffix
行为的修改可能不是一个好的决定。其他项目的
domain_suffix
项目由于历史原因,都采用的那套标准,实际上这会带来语义上的模糊。这套方案丢失了suffix
在string
中的基础语义,仅提供了书写上的便利。而
sing-box
现行domain_suffix
匹配方案与string
中的语义一致,同事可以根据需要进行匹配的精准度把控,在特定情况下亦可减小开销。在以下情况中:
我想匹配
/.+le.com/
,使用现有suffix
我可以直接"domain_suffix": "le.com"
,而匹配方案修改后,我必须使用正则表达式进行匹配,会带来毫无必要的开销。请保留现有
domain_suffix
匹配方案,它不应该为其他匹配规则设计不够完善的代理程序埋单f91a90c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
很多项目都明确说明了语义。
原有语义很少确切被使用,且制造了不便。
在大多数情况下都没有作用。
你的场景很小众,修改很有必要。
你的话充满了没有根据的情绪,如何设计,应该怎么做,以你的认知和技术水平还不够评价。请不要再用长篇大论的事实错误来污染评论了。