Feature: add dns query json api

This commit is contained in:
Dreamacro
2023-01-28 00:55:24 +08:00
committed by metacubex
parent 85db58aeb5
commit a6a72a5b54
5 changed files with 88 additions and 13 deletions
+3
View File
@@ -11,6 +11,8 @@ import (
"time"
"github.com/Dreamacro/clash/component/trie"
"github.com/miekg/dns"
)
var (
@@ -44,6 +46,7 @@ type Resolver interface {
ResolveIP(ctx context.Context, host string) (ip netip.Addr, err error)
ResolveIPv4(ctx context.Context, host string) (ip netip.Addr, err error)
ResolveIPv6(ctx context.Context, host string) (ip netip.Addr, err error)
ExchangeContext(ctx context.Context, m *dns.Msg) (msg *dns.Msg, err error)
}
// LookupIPv4WithResolver same as LookupIPv4, but with a resolver