|
|
|
@ -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,
|
|
|
|
|