feat: DNS-over-HTTPS (DoH) upstream forwarding #14
@@ -162,10 +162,7 @@ mod tests {
|
||||
let body = response_bytes.clone();
|
||||
async move {
|
||||
(
|
||||
[(
|
||||
axum::http::header::CONTENT_TYPE,
|
||||
"application/dns-message",
|
||||
)],
|
||||
[(axum::http::header::CONTENT_TYPE, "application/dns-message")],
|
||||
body,
|
||||
)
|
||||
}
|
||||
@@ -192,7 +189,10 @@ mod tests {
|
||||
match &result.answers[0] {
|
||||
DnsRecord::A { domain, addr, ttl } => {
|
||||
assert_eq!(domain, "example.com");
|
||||
assert_eq!(*addr, "93.184.216.34".parse::<std::net::Ipv4Addr>().unwrap());
|
||||
assert_eq!(
|
||||
*addr,
|
||||
"93.184.216.34".parse::<std::net::Ipv4Addr>().unwrap()
|
||||
);
|
||||
assert_eq!(*ttl, 300);
|
||||
}
|
||||
other => panic!("expected A record, got {:?}", other),
|
||||
@@ -240,8 +240,7 @@ mod tests {
|
||||
client: reqwest::Client::new(),
|
||||
};
|
||||
|
||||
let result =
|
||||
forward_query(&make_query(), &upstream, Duration::from_millis(100)).await;
|
||||
let result = forward_query(&make_query(), &upstream, Duration::from_millis(100)).await;
|
||||
assert!(result.is_err());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,11 +7,11 @@ use log::{error, info};
|
||||
use tokio::net::UdpSocket;
|
||||
|
||||
use numa::blocklist::{download_blocklists, parse_blocklist, BlocklistStore};
|
||||
use numa::forward::Upstream;
|
||||
use numa::buffer::BytePacketBuffer;
|
||||
use numa::cache::DnsCache;
|
||||
use numa::config::{build_zone_map, load_config, ConfigLoad};
|
||||
use numa::ctx::{handle_query, ServerCtx};
|
||||
use numa::forward::Upstream;
|
||||
use numa::override_store::OverrideStore;
|
||||
use numa::query_log::QueryLog;
|
||||
use numa::service_store::ServiceStore;
|
||||
|
||||
Reference in New Issue
Block a user