From 6b3461b61874dc7d408b138bea47f266b11f001e Mon Sep 17 00:00:00 2001 From: Uncle Jack Date: Sat, 6 Jul 2024 18:08:11 +0330 Subject: [PATCH] more verbose logs Signed-off-by: Uncle Jack --- src/proxy.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/proxy.rs b/src/proxy.rs index 0f69e91..b501c9f 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -45,7 +45,7 @@ impl Proxy { { return Err(Error::new( ErrorKind::Other, - "[blocked] source ip is not in the whitelist", + format!("[blocked] source {client_addr} is not in the whitelist"), )); } @@ -108,7 +108,11 @@ async fn handler(config: Arc, header: Header, stream: TcpStream) { .iter() .any(|cidr| cidr.contains(&header.addr)) { - log::info!("[blocked] destination ip is not in the whitelist"); + log::error!( + "[blocked] destination {}:{} is not in the whitelist", + header.addr, + header.port, + ); return; } tcp_handler(stream, header.addr, header.port).await