mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-12-15 11:22:49 +03:00
Also honor the user-defined UpstreamMode for the internal DNS proxy
This commit is contained in:
parent
573cbafe3f
commit
cd8206ad9b
@ -376,13 +376,25 @@ func (s *Server) prepareUpstreamSettings() error {
|
||||
|
||||
// prepareIntlProxy - initializes DNS proxy that we use for internal DNS queries
|
||||
func (s *Server) prepareIntlProxy() {
|
||||
s.internalProxy = &proxy.Proxy{
|
||||
proxyConfig := &proxy.Proxy{
|
||||
Config: proxy.Config{
|
||||
CacheEnabled: true,
|
||||
CacheSizeBytes: 4096,
|
||||
UpstreamConfig: s.conf.UpstreamConfig,
|
||||
MaxGoroutines: int(s.conf.MaxGoroutines),
|
||||
},
|
||||
}
|
||||
|
||||
if s.conf.AllServers {
|
||||
proxyConfig.UpstreamMode = proxy.UModeParallel
|
||||
} else if s.conf.FastestAddr {
|
||||
proxyConfig.UpstreamMode = proxy.UModeFastestAddr
|
||||
proxyConfig.FastestPingTimeout = s.conf.FastestTimeout.Duration
|
||||
} else {
|
||||
proxyConfig.UpstreamMode = proxy.UModeLoadBalance
|
||||
}
|
||||
|
||||
s.internalProxy = proxyConfig
|
||||
}
|
||||
|
||||
// prepareTLS - prepares TLS configuration for the DNS proxy
|
||||
|
Loading…
Reference in New Issue
Block a user