0
mirror of https://github.com/XTLS/Xray-core.git synced 2025-06-19 22:58:03 +03:00

Refine DNS strategies

This commit is contained in:
JimhHan
2021-04-09 23:36:36 +08:00
parent f4a048aa0c
commit 726a722019
21 changed files with 255 additions and 208 deletions

View File

@ -16,11 +16,13 @@ func NewFakeDNSServer() *FakeDNSServer {
return &FakeDNSServer{}
}
const FakeDNSName = "FakeDNS"
func (FakeDNSServer) Name() string {
return "FakeDNS"
return FakeDNSName
}
func (f *FakeDNSServer) QueryIP(ctx context.Context, domain string, _ net.IP, _ dns.IPOption, _ bool) ([]net.IP, error) {
func (f *FakeDNSServer) QueryIP(ctx context.Context, domain string, _ net.IP, _ dns.IPOption, _ CacheStrategy) ([]net.IP, error) {
if f.fakeDNSEngine == nil {
if err := core.RequireFeatures(ctx, func(fd dns.FakeDNSEngine) {
f.fakeDNSEngine = fd