Use the relay for cert retrieval over TCP, tooo
But don't use a relay if a proxy has been specified already
This commit is contained in:
parent
fc9509a8c8
commit
74c1f4a00d
|
@ -248,11 +248,16 @@ func _dnsExchange(proxy *Proxy, proto string, query *dns.Msg, serverAddress stri
|
|||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
upstreamAddr := tcpAddr
|
||||
if relayUDPAddr != nil {
|
||||
proxy.prepareForRelay(tcpAddr.IP, tcpAddr.Port, &binQuery)
|
||||
upstreamAddr = relayTCPAddr
|
||||
}
|
||||
now := time.Now()
|
||||
var pc net.Conn
|
||||
proxyDialer := proxy.xTransport.proxyDialer
|
||||
if proxyDialer == nil {
|
||||
pc, err = net.DialTCP("tcp", nil, tcpAddr)
|
||||
pc, err = net.DialTCP("tcp", nil, upstreamAddr)
|
||||
} else {
|
||||
pc, err = (*proxyDialer).Dial("tcp", tcpAddr.String())
|
||||
}
|
||||
|
|
|
@ -325,7 +325,7 @@ func (proxy *Proxy) exchangeWithTCPServer(serverInfo *ServerInfo, sharedKey *[32
|
|||
if proxyDialer == nil {
|
||||
pc, err = net.DialTCP("tcp", nil, upstreamAddr)
|
||||
} else {
|
||||
pc, err = (*proxyDialer).Dial("tcp", upstreamAddr.String())
|
||||
pc, err = (*proxyDialer).Dial("tcp", serverInfo.TCPAddr.String())
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Reference in New Issue