From 5c9edfccfe67474bee2836ada67f955f10e43357 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sun, 14 Apr 2019 14:19:12 +0200 Subject: [PATCH] Ignore onion servers if Tor is not being used --- dnscrypt-proxy/xtransport.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dnscrypt-proxy/xtransport.go b/dnscrypt-proxy/xtransport.go index 9dca1384..c9267d4e 100644 --- a/dnscrypt-proxy/xtransport.go +++ b/dnscrypt-proxy/xtransport.go @@ -224,6 +224,9 @@ func (xTransport *XTransport) Fetch(method string, url *url.URL, accept string, } var err error host := url.Host + if xTransport.proxyDialer == nil && strings.HasSuffix(host, ".onion") { + return nil, 0, errors.New("Onion service is not reachable without Tor") + } resolveByProxy := false if xTransport.proxyDialer != nil || xTransport.httpProxyFunction != nil { resolveByProxy = true