diff --git a/Cargo.lock b/Cargo.lock index 76cebe7..c382f38 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1555,13 +1555,13 @@ name = "frida_vpn" version = "0.1.7" dependencies = [ "aes-gcm", + "async-channel", "base64 0.22.1", "block-modes", "block-padding", "chrono", "clap", "console-subscriber", - "crossbeam-channel", "dirs 5.0.1", "embed-resource", "env_logger", diff --git a/Cargo.toml b/Cargo.toml index fdad83f..d294189 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ env_logger = "0.9" log = "0.4.20" futures = "0.3.30" packet = "0.1.4" -crossbeam-channel = "0.5.13" +async-channel = "2.3.1" hex = "0.4" serde_yaml = "0.9.34" x25519-dalek = { version = "2.0.1", features = ["getrandom", "static_secrets"] } diff --git a/src/client.rs b/src/client.rs index 801d1a6..8ee5102 100644 --- a/src/client.rs +++ b/src/client.rs @@ -1,7 +1,7 @@ pub mod general { use crate::config::ClientConfiguration; - use crossbeam_channel::{Receiver, Sender}; + use async_channel::{Receiver, Sender}; use futures::{stream::SplitSink, StreamExt}; use tokio_util::{codec::Framed, sync::CancellationToken}; use tokio::{net::UdpSocket, sync::{Mutex, mpsc}, io::{AsyncWriteExt, AsyncReadExt}, fs::File}; @@ -29,7 +29,7 @@ pub mod general { // TODO: implement custom Error impl ReadWrapper for DevReader { async fn read(&mut self, buf: &mut Vec) -> Result { - if let Ok(tb) = self.dr.recv() { + if let Ok(tb) = self.dr.recv().await { *buf = tb; return Ok(buf.len()); } @@ -70,7 +70,7 @@ pub mod general { match msg { WriterMessage::Plain(buf) => { let l = buf.len(); - if let Ok(()) = self.dr.send(buf) { + if let Ok(()) = self.dr.send(buf).await { return Ok(l); } Err(()) @@ -278,7 +278,7 @@ pub mod desktop { use futures::{SinkExt, StreamExt}; use log::info; use tokio::net::UdpSocket; - use crossbeam_channel::unbounded; + use async_channel::unbounded; #[cfg(target_os = "linux")] use network_interface::{NetworkInterface, NetworkInterfaceConfig}; @@ -388,7 +388,7 @@ pub mod desktop { tokio::spawn(async move { loop { - if let Ok(buf) = wrx.recv() { + if let Ok(buf) = wrx.recv().await { let _ = dev_writer.send(buf).await; } }