File tree Expand file tree Collapse file tree 1 file changed +1
-9
lines changed
Expand file tree Collapse file tree 1 file changed +1
-9
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ import (
2020 "math/rand/v2"
2121 "net"
2222 "net/http"
23- "net/url"
2423 "os"
2524 "path/filepath"
2625 "strconv"
@@ -151,19 +150,12 @@ func (c *WireConn) Write(b []byte) (n int, err error) {
151150
152151// ResolverDoh returns a DoH resolver. For further information, see https://datatracker.ietf.org/doc/html/rfc8484.
153152func ResolverDoh (addr string ) * net.Resolver {
154- urls := doa .Try (url .Parse (addr ))
155- host := doa .Try (net .LookupHost (urls .Hostname ()))[0 ]
156- port := urls .Port ()
157- urls .Host = host
158- if port != "" {
159- urls .Host = host + ":" + port
160- }
161153 return & net.Resolver {
162154 PreferGo : true ,
163155 Dial : func (ctx context.Context , network , address string ) (net.Conn , error ) {
164156 conn := & WireConn {
165157 Call : func (b []byte ) ([]byte , error ) {
166- resp , err := http .Post (urls . String () , "application/dns-message" , bytes .NewReader (b ))
158+ resp , err := http .Post (addr , "application/dns-message" , bytes .NewReader (b ))
167159 if err != nil {
168160 return nil , err
169161 }
You can’t perform that action at this time.
0 commit comments