1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 06:16:04 +00:00

add a bit more logging to handshake_proxy

This commit is contained in:
mat 2024-12-23 07:31:51 +00:00
parent 2c37ade959
commit fa132b61fc

View file

@ -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
);