Use ODoH relays in probes

This commit is contained in:
Frank Denis 2021-06-07 12:23:26 +02:00
parent a11da2d4fb
commit 94151f9f96
1 changed files with 6 additions and 2 deletions

View File

@ -712,7 +712,7 @@ func _fetchODoHTargetInfo(proxy *Proxy, name string, stamp stamps.ServerStamp, i
dlog.Debugf("Pausing done")
}
url := &url.URL{
targetURL := &url.URL{
Scheme: "https",
Host: stamp.ProviderName,
Path: stamp.Path,
@ -730,6 +730,10 @@ func _fetchODoHTargetInfo(proxy *Proxy, name string, stamp stamps.ServerStamp, i
if err != nil {
continue
}
url := targetURL
if relay != nil {
url = relay.ODoH.URL
}
responseBody, responseCode, tls, rtt, err := proxy.xTransport.ObliviousDoHQuery(useGet, url, odohQuery.odohMessage, proxy.timeout)
if err != nil {
continue
@ -803,7 +807,7 @@ func _fetchODoHTargetInfo(proxy *Proxy, name string, stamp stamps.ServerStamp, i
Proto: stamps.StampProtoTypeODoHTarget,
Name: name,
Timeout: proxy.timeout,
URL: url,
URL: targetURL,
HostName: stamp.ProviderName,
initialRtt: xrtt,
useGet: useGet,