chore: mix the proxy adapter and interface to dns client
This commit is contained in:
10
dns/doq.go
10
dns/doq.go
@ -168,15 +168,19 @@ func (dc *quicClient) openSession() (quic.Connection, error) {
|
||||
}
|
||||
} else {
|
||||
conn, err := dialContextWithProxyAdapter(context.Background(), dc.proxyAdapter, "udp", ip, port)
|
||||
if err != nil {
|
||||
if err == errProxyNotFound {
|
||||
options := []dialer.Option{dialer.WithInterface(dc.proxyAdapter), dialer.WithRoutingMark(0)}
|
||||
conn, err = dialContextWithProxyAdapter(context.Background(), dc.proxyAdapter, "udp", ip, port, options...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
wrapConn, ok := conn.(*wrapPacketConn)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("quio create packet failed")
|
||||
}
|
||||
|
||||
udp = wrapConn
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user