|
|
@@ -74,9 +74,10 @@ func TestDNSConfigParsing(t *testing.T) {
|
|
|
}],
|
|
|
"hosts": {
|
|
|
"example.com": "127.0.0.1",
|
|
|
+ "xtls.github.io": ["1.2.3.4", "5.6.7.8"],
|
|
|
"domain:example.com": "google.com",
|
|
|
- "geosite:test": "10.0.0.1",
|
|
|
- "keyword:google": "8.8.8.8",
|
|
|
+ "geosite:test": ["127.0.0.1", "127.0.0.2"],
|
|
|
+ "keyword:google": ["8.8.8.8", "8.8.4.4"],
|
|
|
"regexp:.*\\.com": "8.8.4.4"
|
|
|
},
|
|
|
"clientIp": "10.0.0.1",
|
|
|
@@ -127,18 +128,23 @@ func TestDNSConfigParsing(t *testing.T) {
|
|
|
{
|
|
|
Type: dns.DomainMatchingType_Full,
|
|
|
Domain: "example.com",
|
|
|
- Ip: [][]byte{{10, 0, 0, 1}},
|
|
|
+ Ip: [][]byte{{127, 0, 0, 1}, {127, 0, 0, 2}},
|
|
|
},
|
|
|
{
|
|
|
Type: dns.DomainMatchingType_Keyword,
|
|
|
Domain: "google",
|
|
|
- Ip: [][]byte{{8, 8, 8, 8}},
|
|
|
+ Ip: [][]byte{{8, 8, 8, 8}, {8, 8, 4, 4}},
|
|
|
},
|
|
|
{
|
|
|
Type: dns.DomainMatchingType_Regex,
|
|
|
Domain: ".*\\.com",
|
|
|
Ip: [][]byte{{8, 8, 4, 4}},
|
|
|
},
|
|
|
+ {
|
|
|
+ Type: dns.DomainMatchingType_Full,
|
|
|
+ Domain: "xtls.github.io",
|
|
|
+ Ip: [][]byte{{1, 2, 3, 4}, {5, 6, 7, 8}},
|
|
|
+ },
|
|
|
},
|
|
|
ClientIp: []byte{10, 0, 0, 1},
|
|
|
QueryStrategy: dns.QueryStrategy_USE_IP4,
|