Implemented setting bind-host for DNS-resolver.

This commit is contained in:
Revertron
2021-02-22 22:02:01 +01:00
parent d7911dfe04
commit 074a709f3b
5 changed files with 15 additions and 5 deletions
+3
View File
@@ -46,6 +46,7 @@ pub struct ServerContext {
pub cache: SynchronizedCache,
pub filters: Vec<Box<dyn DnsFilter + Sync + Send>>,
pub client: Box<dyn DnsClient + Sync + Send>,
pub dns_host: String,
pub dns_port: u16,
pub api_port: u16,
pub resolve_strategy: ResolveStrategy,
@@ -70,6 +71,7 @@ impl ServerContext {
cache: SynchronizedCache::new(),
filters: Vec::new(),
client: Box::new(DnsNetworkClient::new(34255)),
dns_host: String::from("0.0.0.0"),
dns_port: 53,
api_port: 5380,
resolve_strategy: ResolveStrategy::Recursive,
@@ -127,6 +129,7 @@ pub mod tests {
cache: SynchronizedCache::new(),
filters: Vec::new(),
client: Box::new(DnsStubClient::new(callback)),
dns_host: String::from("0.0.0.0"),
dns_port: 53,
api_port: 5380,
resolve_strategy: ResolveStrategy::Recursive,