chore: 调整dns interface与adapter部分
This commit is contained in:
@ -3,7 +3,6 @@ package dns
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/netip"
|
||||
@ -20,8 +19,6 @@ import (
|
||||
D "github.com/miekg/dns"
|
||||
)
|
||||
|
||||
var errProxyNotFound = errors.New("proxy adapter not found")
|
||||
|
||||
func putMsgToCache(c *cache.LruCache[string, *D.Msg], key string, msg *D.Msg) {
|
||||
var ttl uint32
|
||||
switch {
|
||||
@ -146,10 +143,11 @@ func (wpc *wrapPacketConn) RemoteAddr() net.Addr {
|
||||
return wpc.rAddr
|
||||
}
|
||||
|
||||
func dialContextWithProxyAdapter(ctx context.Context, adapterName string, network string, dstIP netip.Addr, port string, opts ...dialer.Option) (net.Conn, error) {
|
||||
func dialContextExtra(ctx context.Context, adapterName string, network string, dstIP netip.Addr, port string, opts ...dialer.Option) (net.Conn, error) {
|
||||
adapter, ok := tunnel.Proxies()[adapterName]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("proxy adapter [%s] not found", adapterName)
|
||||
opts = append(opts, dialer.WithInterface(adapterName))
|
||||
adapter, _ = tunnel.Proxies()[tunnel.Direct.String()]
|
||||
}
|
||||
|
||||
networkType := C.TCP
|
||||
|
Reference in New Issue
Block a user