Closed
Conversation
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.
概述
在保留原有 API 下发自定义出站机制的基础上,新增从本地配置文件(
config.yml)加载自定义出站代理及路由匹配规则的能力。本地配置优先级高于 API 下发,同名出站以本地为准。动机
变更内容
conf/conf.goOutboundConfig结构体及Conf.Outbound字段core/custom.gomergeOutboundList()本地优先合并函数;提取parseDomainRules()消除重复代码;修改GetCustomConfig()签名以接收本地出站配置core/xray.goGetCustomConfig()时传入c.Outbound合并优先级
Outbound段配置示例
支持的协议:
http/socks/shadowsocks/trojan/vmess/vless支持的规则格式:
suffix:域名suffix:google.comkeyword:关键词keyword:openairegex:正则regex:.*\.gov\.cn$geositegeosite:cngeoipgeoip:cnexample.com附带重构
将域名规则解析逻辑从 DNS / Block / Outbound 三处重复代码中提取为公共函数
parseDomainRules(),减少约 40 行重复代码,后续新增规则格式只需修改一处。兼容性
Outbound段时行为不变--watch机制自动生效编译验证