feat: add built-in proxy PASS-RULE#2873
Merged
Merged
Conversation
新增 PassRule 代理策略的类型枚举和字符串映射
增加 PASS-RULE 内置代理策略
在配置解析器中注册 PASS-RULE 策略,并将其从全局策略组(Selector/Fallback 等)的节点列表中排除。
新增 CheckPassRule 函数签名
在主路由实例化 RuleMatchHelper 时,注入代理池读取与 Unwrap 解包逻辑,并增加主规则 PASS-RULE 的跳过兜底处理。
重构 matchSubRules 逻辑,利用 helper.CheckPassRule 识别目标策略,实现命中 PASS-RULE 时静默吃掉结果并继续匹配当前子规则内的后续规则。
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
与PASS的区别是:在sub-rule中命中PASS-RULE时不会跳出子规则,仅跳过当前命中规则分支,继续在sub-rule中向后匹配规则。
参考用途示例:
优点:可通过策略组快速决定是否禁用代理QUIC流量;规则匹配效率高,可不重复匹配规则(之前想实现类似效果要么将禁用quic写死到规则中,要么需要匹配两次同一规则才行)
