github.com/Asutorufa/yuhaiin@v0.3.6-0.20240502055049-7984da7023a0/pkg/net/dns/doh3_test.go (about) 1 package dns 2 3 import ( 4 "context" 5 "testing" 6 7 "github.com/Asutorufa/yuhaiin/pkg/net/netapi" 8 "github.com/Asutorufa/yuhaiin/pkg/protos/config/dns" 9 "github.com/Asutorufa/yuhaiin/pkg/utils/assert" 10 ) 11 12 func TestDoh3(t *testing.T) { 13 netapi.Bootstrap = &netapi.SystemResolver{} 14 15 configMap := map[string]Config{ 16 "cloudflare": { 17 Type: dns.Type_doh3, 18 Host: "cloudflare-dns.com", 19 }, 20 } 21 22 c, err := New(configMap["cloudflare"]) 23 assert.NoError(t, err) 24 25 t.Log(c.LookupIP(context.TODO(), "www.google.com")) 26 t.Log(c.LookupIP(context.TODO(), "www.baidu.com")) 27 t.Log(c.LookupIP(context.TODO(), "www.qq.com")) 28 }