-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathXray-core--routing.txt
110 lines (55 loc) · 3.14 KB
/
Xray-core--routing.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
Xray-core routing:
State 1: The routing entry address is an IP:
That IP is always used in the outbound.
////
State 2: The routing entry address is an IP with a domain:
This happens when the initial-entry-address in inbound is an IP and Sniffing is on and "use-sniffed-domain-in-routing" is true
State 2.1: an ip-rule is matched:
The IP used in outbound unless "domainOverride" is true.
State 2.2: a domain-rule is matched:
The Domain is used in outbound unless "ipOverride" is true.
State 2.3: a non-ip/domain-rule is matched:
The IP is used in outbound unless "domainOverride" is true.
State 2.4: a both-ip-domain-rule is matched:
The IP is used in outbound unless "domainOverride" is true.
State 2.5: no rule is matched:
The IP is used in outbound (first-outbound).
////
State 3: The routing entry address is a domain:
State 3.1: the domainStrategy is AsIs:
That domain is always used in the outbound.
State 3.2: the domainStrategy is IPOnDemand:
At the first encounter with an IP-rule/both-ip-domain-rule, the domain is resolved to IP(IP-list).
By encountering each rule the domain and all ips in ip-list is checked.
State 3.2.1: an ip-rule is matched:
The first IP of the IP-list that has matched the rule is used in outbound, unless "domainOverride" is true.
State 3.2.2: a domain-rule is matched:
The Domain is used in outbound.
State 3.2.3: a non-ip/domain-rule is matched:
The Domain is used in outbound.
State 3.2.4: a both-ip-domain-rule is matched:
The Domain is used in outbound, unless "overrideIP" is true.
State 3.2.5: no rule is matched:
The Domain is used in outbound (first-outbound).
State 3.3: the domainStrategy is IPIfNonMatch:
if no rule is matched, the domain is resolved to IP(IP-list) and check again.
State 3.3.1: an IP-rule is matched:
Impossible!
State 3.3.2: a domain-rule is matched:
The Domain is always used in outbound
State 3.3.3: a non-ip/domain-rule is matched:
The Domain is always used in outbound
State 3.3.4: a both-ip-domain-rule is matched:
Impossible!
State 3.3.5: no rule is matched:
Now, The Domain is resolved to IP(IP-list) and check again
State 3.3.5.1: an ip-rule is matched:
The first IP of the IP-list that has matched the rule is used in outbound, unless "domainOverride" is true.
State 3.3.5.2: a domain-rule is matched:
Impossible!
State 3.3.5.3: a non-ip/domain-rule is matched:
Impossible!
State 3.3.5.4: a both-ip-domain-rule is matched:
The Domain is used in outbound, unless "overrideIP" is true.
State 3.3.5.5: no rule is matched:
The Domain is used in outbound (first-outbound).