-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] 可否新增一个子命令用于输出或检测一个域名或 IP 的最终分流结果 #3311
Comments
curl -x http://127.0.0.1:1081 https://google.com |
确实,也就 |
那日志完全可以做到吧 |
直接在生产环境测路由不太好吧。单独开个core用来测路由就没其他信息干扰。 所以目前的问题只是debug log不够详细。 |
问题是core设计的时候并没有给规则设置tag的功能 哪怕加也没办法指明规则是哪条( |
@Fangliding 可以用数组索引呀,比如配置文件如下: "routing": {
"rules": [
{
"type": "field",
"outboundTag": "Reject",
"domain": ["geosite:category-ads-all"]
},
{
"type": "field",
"outboundTag": "Direct",
"domain": [
"geosite:private",
"domain:baidu.com",
"geosite:apple-cn",
"geosite:google-cn",
"geosite:tld-cn",
"geosite:category-games@cn"
]
},
{
"type": "field",
"outboundTag": "Proxy",
"domain": [
"geosite:twitter",
"geosite:geolocation-!cn"
]
},
{
"type": "field",
"outboundTag": "Direct",
"domain": ["geosite:cn"]
},
{
"type": "field",
"outboundTag": "Proxy",
"network": "tcp,udp"
}
]
} 以 sing-box 举例,有一个 如果执行 Current domainStrategy: AsIs
Use DNS: local
Match rule: rules[1]
Match domain: domain[1]: "domain:baidu.com"
Use outbound: Direct 如果执行 Current domainStrategy: AsIs
Use DNS: 8.8.8.8
Match rule: rules[2]
Match domain: domain[0]: "geosite:twitter > twitter.com[11]" # 第 11 行
Use outbound: Singapore 如果执行 Current domainStrategy: AsIs
Use DNS: 8.8.8.8
Match rule: rules[2]
Match domain: domain[1]: "geosite:geolocation-!cn > geosite:google > google.com[114]" # 第 114 行
Use outbound: Proxy 突然感觉叫做 |
提问之前可以先查一下源代码 |
#3809 应该可以解决问题了
回旋镖:还真有 |
这个命令的用法大概是这样:
xray test www.google.com
这个命令会结合当前的
config.json
中的routing.domainStrategy
和routing.rules
以及geosite.dat
、geoip.dat
等输出一个域名或 IP 详细的分流过程和最终的分流结果这个命令大概有如下用途:
这个命令大概的输出如下:
由于目前添加、修改规则有点黑盒状态,需要添加完成后在日志或者浏览器中验证,如果有这样一个命令的话,就可以在添加、修改规则之前以一种离线的方式来验证,感觉对编写精确的规则配置会非常有用
The text was updated successfully, but these errors were encountered: