mirror of
https://github.com/AdguardTeam/dnsproxy.git
synced 2026-10-12 02:01:26 +00:00
Merge in DNS/dnsproxy from doh3 to master
Squashed commit of the following:
commit 93dc50875caf2df86ce08f22f5fb74e33b7b5ac0
Author: Andrey Meshkov <[email protected]>
Date: Fri Sep 16 18:33:38 2022 +0300
fix review comments
commit d19fd61eb69f31c94a9374396cbbefeb566a2163
Author: Andrey Meshkov <[email protected]>
Date: Fri Sep 16 17:28:21 2022 +0300
upstream: added comments, minor fixes
commit 9e4bf71275e9d1d3bc1cd72e27812548e8158402
Author: Andrey Meshkov <[email protected]>
Date: Fri Sep 16 16:59:57 2022 +0300
upstream: added DoH3 support, added TLS resumption
The changes are pretty considerable in this PR.
First of all, DoH3 support has been added to dnsOverHTTPS. I haven't added
a new type of upstream for that, but added it to the already existing one.
Configuring supported HTTP versions is possible via upstream.Options. When all
versions are enabled, it will "probe" both TLS and QUIC and choose the one that
was faster (just like it's done in Chrome).
Command-line interface now supports a new argument "http3" that is supposed to
enable HTTP/3 globally. At this point it will only enable it for upstreams, but
in the future it will also enable it for the DoH server.
One more important change here is the introduction of TLS sessions cache. It
appears that we weren't benefiting from TLS session resumption mechanism at all,
thank god this is finally fixed.
Finally, AddressToUpstream now supports "h3://" scheme for those who want to try
DoH3 for a particular upstream without enabling it globally. The reasoning for
implementing this custom scheme is the following: currently, only a small share
of public resolvers fully support DoH3. Users may not want to spend time
"probing" every upstream for H3.
commit 8c76e435860699a2d5815fc702b7a7e928eba3ed
Merge: 1145771 1dd831b
Author: Andrey Meshkov <[email protected]>
Date: Fri Sep 16 12:05:34 2022 +0300
Merge branch 'justus-forks-doq-0rtt' into doh3
commit 1145771f7621be5778cf14b47ccfb4aa20d07c81
Author: Andrey Meshkov <[email protected]>
Date: Fri Sep 16 11:45:42 2022 +0300
upstream: initial attempt to add a DOH3 upstream
25 lines
537 B
Go
25 lines
537 B
Go
//go:build !plan9
|
|
// +build !plan9
|
|
|
|
package proxy
|
|
|
|
import (
|
|
"syscall"
|
|
|
|
"github.com/AdguardTeam/golibs/errors"
|
|
)
|
|
|
|
// isEPIPE checks if the underlying error is EPIPE. syscall.EPIPE exists on all
|
|
// OSes except for Plan 9. Validate with:
|
|
//
|
|
// $ for os in $(go tool dist list | cut -d / -f 1 | sort -u)
|
|
// do
|
|
// echo -n "$os"
|
|
// env GOOS="$os" go doc syscall.EPIPE | grep -F -e EPIPE
|
|
// done
|
|
//
|
|
// For the Plan 9 version see ./errors_plan9.go.
|
|
func isEPIPE(err error) (ok bool) {
|
|
return errors.Is(err, syscall.EPIPE)
|
|
}
|