DNS: Implement queryStrategy for "localhost" (#4303)

Fixes https://github.com/XTLS/Xray-core/issues/4302
This commit is contained in:
风扇滑翔翼 2025-01-19 15:39:54 +08:00 committed by GitHub
parent 14a6636a41
commit f4fd8b8fad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 6 deletions

View file

@ -12,7 +12,7 @@ import (
)
func TestLocalNameServer(t *testing.T) {
s := NewLocalNameServer()
s := NewLocalNameServer(QueryStrategy_USE_IP)
ctx, cancel := context.WithTimeout(context.Background(), time.Second*2)
ips, err := s.QueryIP(ctx, "google.com", net.IP{}, dns.IPOption{
IPv4Enable: true,