From fb0289bb4c35a09babd652aa931dfea22f7d0421 Mon Sep 17 00:00:00 2001 From: Dreamacro <305009791@qq.com> Date: Mon, 1 Jun 2020 13:43:26 +0800 Subject: [PATCH] Chore: open ForceAttemptHTTP2 on DoH --- dns/doh.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dns/doh.go b/dns/doh.go index 8715393..ee26e7c 100644 --- a/dns/doh.go +++ b/dns/doh.go @@ -44,7 +44,7 @@ func (dc *dohClient) newRequest(m *D.Msg) (*http.Request, error) { return nil, err } - req, err := http.NewRequest(http.MethodPost, dc.url+"?bla=foo:443", bytes.NewReader(buf)) + req, err := http.NewRequest(http.MethodPost, dc.url, bytes.NewReader(buf)) if err != nil { return req, err } @@ -75,7 +75,8 @@ func newDoHClient(url string, r *Resolver) *dohClient { return &dohClient{ url: url, transport: &http.Transport{ - TLSClientConfig: &tls.Config{ClientSessionCache: globalSessionCache}, + TLSClientConfig: &tls.Config{ClientSessionCache: globalSessionCache}, + ForceAttemptHTTP2: true, DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) { host, port, err := net.SplitHostPort(addr) if err != nil {