diff --git a/proxy/src/bin/async.rs b/proxy/src/bin/async.rs index 383d338..831f65d 100644 --- a/proxy/src/bin/async.rs +++ b/proxy/src/bin/async.rs @@ -44,7 +44,7 @@ async fn proxy_conn(mut client: TcpStream) -> Result<(), bip324_proxy::Error> { // TODO: Make this robust. let mut remote_garbage_and_version = vec![0u8; 5000]; remote.read(&mut remote_garbage_and_version).await?; - let packet_reader = handshake + let packet_handler = handshake .authenticate_garbage_and_version(&remote_garbage_and_version) .expect("authenticated garbage"); println!("Channel authenticated."); @@ -52,7 +52,7 @@ async fn proxy_conn(mut client: TcpStream) -> Result<(), bip324_proxy::Error> { println!("Splitting channels."); let (mut client_reader, mut client_writer) = client.split(); let (mut remote_reader, mut remote_writer) = remote.split(); - let (mut decrypter, mut encrypter) = packet_reader.split(); + let (mut decrypter, mut encrypter) = packet_handler.split(); println!("Setting up proxy loop."); loop { diff --git a/proxy/src/lib.rs b/proxy/src/lib.rs index 0589a0f..264b0c1 100644 --- a/proxy/src/lib.rs +++ b/proxy/src/lib.rs @@ -117,6 +117,7 @@ pub async fn read_v2( let packet_bytes = decrypter.decypt_len(length_bytes); let mut packet_bytes = vec![0u8; packet_bytes]; input.read_exact(&mut packet_bytes).await?; + let message = RawNetworkMessage::magic() Ok(todo!()) }