Add dns transports

This commit is contained in:
世界
2022-07-06 18:48:11 +08:00
parent 81330d32e0
commit 651c4b539a
10 changed files with 910 additions and 3 deletions

18
dns/transport.go Normal file
View File

@@ -0,0 +1,18 @@
package dns
import (
"context"
"net/netip"
"github.com/sagernet/sing-box/adapter"
C "github.com/sagernet/sing-box/constant"
"golang.org/x/net/dns/dnsmessage"
)
type Transport interface {
adapter.Service
Raw() bool
Exchange(ctx context.Context, message *dnsmessage.Message) (*dnsmessage.Message, error)
Lookup(ctx context.Context, domain string, strategy C.DomainStrategy) ([]netip.Addr, error)
}