cherry-pick: 4166 udp upstream
Merge in DNS/adguard-home from 4166-udp-upstream to master
Closes #4166.
Squashed commit of the following:
commit b8b6d1c7ac1e11e83c0c68e46e7f66fdc6043839
Merge: e5f01273 ea6e033d
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Tue Mar 1 20:36:40 2022 +0300
Merge branch 'master' into 4166-udp-upstream
commit e5f0127384d84c4395da5b79a1fd4a47acbe122c
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Tue Mar 1 19:41:33 2022 +0300
client: upd upstream examples
commit bd974f22231f11f4c57e19d6d13bc45dbfdf2fdf
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Tue Mar 1 18:36:10 2022 +0300
all: upd proxy
commit badf1325090ecd1dc86e42e7406dfb6653e07bf1
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Fri Feb 4 14:36:50 2022 +0300
WIP
This commit is contained in:
parent
6a4a9a0239
commit
941cd2a562
|
@ -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>
|
||||
|
@ -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>
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue