Skip to content

Commit

Permalink
cherry-pick: 4166 udp upstream
Browse files Browse the repository at this point in the history
Merge in DNS/adguard-home from 4166-udp-upstream to master

Closes #4166.

Squashed commit of the following:

commit b8b6d1c
Merge: e5f0127 ea6e033
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Tue Mar 1 20:36:40 2022 +0300

    Merge branch 'master' into 4166-udp-upstream

commit e5f0127
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Tue Mar 1 19:41:33 2022 +0300

    client: upd upstream examples

commit bd974f2
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Tue Mar 1 18:36:10 2022 +0300

    all: upd proxy

commit badf132
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Fri Feb 4 14:36:50 2022 +0300

    WIP
  • Loading branch information
EugeneOne1 authored and ainar-g committed Jun 2, 2022
1 parent 6a4a9a0 commit 941cd2a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
12 changes: 9 additions & 3 deletions client/src/components/Settings/Dns/Upstream/Examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ const Examples = (props) => (
<li>
<code>94.140.14.140</code>: {props.t('example_upstream_regular')}
</li>
<li>
<code>udp://dns-unfiltered.adguard.com</code>: <Trans>example_upstream_udp</Trans>
</li>
<li>
<code>tcp://94.140.14.140</code>: <Trans>example_upstream_tcp</Trans>
</li>
<li>
<code>tcp://dns-unfiltered.adguard.com</code>: <Trans>example_upstream_tcp_hostname</Trans>
</li>
<li>
<code>tls://dns-unfiltered.adguard.com</code>:
<span>
Expand Down Expand Up @@ -67,9 +76,6 @@ const Examples = (props) => (
</Trans>
</span>
</li>
<li>
<code>tcp://94.140.14.140</code>: <Trans>example_upstream_tcp</Trans>
</li>
<li>
<code>sdns://...</code>:
<span>
Expand Down
2 changes: 1 addition & 1 deletion internal/dnsforward/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ func ValidateUpstreams(upstreams []string) (err error) {
return nil
}

var protocols = []string{"tls://", "https://", "tcp://", "sdns://", "quic://"}
var protocols = []string{"udp://", "tcp://", "tls://", "https://", "sdns://", "quic://"}

func validateUpstream(u string) (useDefault bool, err error) {
// Check if the user tries to specify upstream for domain.
Expand Down
8 changes: 8 additions & 0 deletions internal/dnsforward/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,14 @@ func TestValidateUpstream(t *testing.T) {
name: "valid_default",
upstream: "sdns://AQMAAAAAAAAAFDE3Ni4xMDMuMTMwLjEzMDo1NDQzINErR_JS3PLCu_iZEIbq95zkSV2LFsigxDIuUso_OQhzIjIuZG5zY3J5cHQuZGVmYXVsdC5uczEuYWRndWFyZC5jb20",
wantErr: ``,
}, {
wantDef: assert.True,
name: "default_udp_host",
upstream: "udp://dns.google",
}, {
wantDef: assert.True,
name: "default_udp_ip",
upstream: "udp://8.8.8.8",
}, {
wantDef: assert.False,
name: "valid",
Expand Down

0 comments on commit 941cd2a

Please sign in to comment.