Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable ForceAttemptHTTP2 on DoH client #72

Merged
merged 1 commit into from
Jul 31, 2020
Merged

Enable ForceAttemptHTTP2 on DoH client #72

merged 1 commit into from
Jul 31, 2020

Conversation

darhwa
Copy link
Contributor

@darhwa darhwa commented Jul 31, 2020

With this, DoH client can automatically enable http2 if server (very likely) supports it. It hopefully reduces latency, which is very crucial for DNS.

Previously, sendQuery() sent multiple requests simultaneously, and I observed frequent error logs like:

2020/07/31 22:52:32 [Error] v2ray.com/core/app/dns: failed to retrieve response > Post "https://1.1.1.1/dns-query": context deadline exceeded

Because http/1.x doesn't intrinsically support multiplexing, the multiple waiting goroutines are not guaranteed to get responses in the order of requests. So, this is actually a bug fix :)

@kslr kslr merged commit 45bf578 into v2fly:master Jul 31, 2020
@darhwa
Copy link
Contributor Author

darhwa commented Jul 31, 2020

Thanks for the instant merge!

@darhwa darhwa deleted the doh-h2 branch July 31, 2020 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants