From fa132b61fcd23974a1a34bc05fc4c309d304b3d1 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 23 Dec 2024 07:31:51 +0000 Subject: [PATCH] add a bit more logging to handshake_proxy --- azalea-protocol/examples/handshake_proxy.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/azalea-protocol/examples/handshake_proxy.rs b/azalea-protocol/examples/handshake_proxy.rs index 7ff7eaae6..f50300d09 100644 --- a/azalea-protocol/examples/handshake_proxy.rs +++ b/azalea-protocol/examples/handshake_proxy.rs @@ -55,6 +55,9 @@ async fn main() -> anyhow::Result<()> { // Bind to an address and port let listener = TcpListener::bind(LISTEN_ADDR).await?; + + info!("Listening on {LISTEN_ADDR}, proxying to {PROXY_ADDR}"); + loop { // When a connection is made, pass it off to another thread let (stream, _) = listener.accept().await?; @@ -75,8 +78,10 @@ async fn handle_connection(stream: TcpStream) -> anyhow::Result<()> { Ok(packet) => match packet { ServerboundHandshakePacket::Intention(packet) => { info!( - "New connection: {0}, Version {1}, {2:?}", + "New connection from {}, hostname {:?}:{}, version {}, {:?}", ip.ip(), + packet.hostname, + packet.port, packet.protocol_version, packet.intention );