feat: add queryStrategy option for DNS

This commit is contained in:
AkinoKaede
2021-03-19 23:33:07 +08:00
parent 41d3f31447
commit 8382b29922
16 changed files with 419 additions and 267 deletions
+6 -2
View File
@@ -77,7 +77,9 @@ func TestDNSConfigParsing(t *testing.T) {
"keyword:google": "8.8.8.8",
"regexp:.*\\.com": "8.8.4.4"
},
"clientIp": "10.0.0.1"
"clientIp": "10.0.0.1",
"queryStrategy": "UseIPv4",
"disableCache": true
}`,
Parser: parserCreator(),
Output: &dns.Config{
@@ -133,7 +135,9 @@ func TestDNSConfigParsing(t *testing.T) {
Ip: [][]byte{{8, 8, 4, 4}},
},
},
ClientIp: []byte{10, 0, 0, 1},
ClientIp: []byte{10, 0, 0, 1},
QueryStrategy: dns.QueryStrategy_USE_IP4,
DisableCache: true,
},
},
})