debug: dns proxy

This commit is contained in:
Ishan Jain 2023-12-12 04:15:37 +05:30
parent a929cfce73
commit c498b08b5c
Signed by: ishan
GPG Key ID: 0506DB2A1CC75C27

View File

@ -25,6 +25,8 @@ fn main() {
println!("Received {} bytes from {}", size, source);
let received_data = &buf[0..size];
println!("{:0x?}", received_data);
upstream_socket
.send_to(received_data, resolver)
.expect("error in sending data to upstream");
@ -52,6 +54,10 @@ fn main() {
recv_packet.header.authority_records = 0;
recv_packet.header.additional_records = 0;
for question in recv_packet.questions.iter() {
println!("{}", question.name);
}
recv_packet.answers = upstream_packet.answers;
let mut response = vec![];