关于域名规则和IP规则优先级的问题 #2816
Replies: 3 comments 2 replies
-
AsIs下是按从上到下的顺序走,假设这个连接有两个属性,分别匹配到规则1和规则2,会优先命中规则1;假设是IPOnDemand,所有的域名都会在遇到IP规则时被解析为IP地址进行匹配;假设是IPIfNonMatch,会首先AsIs进行一轮匹配,若是没有任何规则能匹配到,那么会重新使用IPOnDemand在第二轮进行匹配。 |
Beta Was this translation helpful? Give feedback.
-
接收到的请求是IP,你使用了sniffing和destOverride,得到了域名。进入路由部分。用AsI要,我认为也选是用域名作为条件去匹配,从上到下,就命中代理了。 假设你没有代理那段规则。应该是命中IP直连。具体你可以找个网址写下具体规则,日志用debug看看处理的逻辑顺序 。 |
Beta Was this translation helpful? Give feedback.
-
Given the routing rules: 1: Rule for the domain: If the connection is to example.com, it is set to go through a proxy. Since example.com resolves to 1.2.3.4, we have a connection that has two attributes, presumably the domain name and the IP address. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
如果要访问的域名在进入xray之前就已经被解析出了IP,那么入站后xray会优先匹配域名规则还是优先匹配IP规则呢?
举例:要访问example.com,首先被本地的smartdns(或mosdns)解析出IP为1.2.3.4,然后该IP进入xray,此时xray客户端的部分配置如下:
如果按照IP规则来匹配,那么最终会直连出站;
但是由于入站配置开启了sniffing和destOverride,xray会从IP1.2.3.4嗅探出对应的域名example.com,同时由于路由配置的domainStrategy为AsIs,所以按照域名规则应该要走代理出站。
请问这两者哪个优先级更高?
Beta Was this translation helpful? Give feedback.
All reactions