mirror of
https://github.com/daeuniverse/dae.git
synced 2025-07-21 05:09:55 +07:00
refactor(dns): replace dnsmessage with miekg/dns (#188)
This commit is contained in:
22
common/netutils/ip46_test.go
Normal file
22
common/netutils/ip46_test.go
Normal file
@ -0,0 +1,22 @@
|
||||
package netutils
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/netip"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/mzz2017/softwind/protocol/direct"
|
||||
)
|
||||
|
||||
func TestResolveIp46(t *testing.T) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
ip46, err := ResolveIp46(ctx, direct.SymmetricDirect, netip.MustParseAddrPort("223.5.5.5:53"), "www.apple.com", "udp", false)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !ip46.Ip4.IsValid() && !ip46.Ip6.IsValid() {
|
||||
t.Fatal("No record")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user