Skip to content

Commit

Permalink
add a bit more logging to handshake_proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-1 committed Dec 23, 2024
1 parent 2c37ade commit fa132b6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion azalea-protocol/examples/handshake_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
Expand All @@ -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
);
Expand Down

0 comments on commit fa132b6

Please sign in to comment.