diff --git a/README.md b/README.md index a1fbc18..7aa4096 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,6 @@ If no path is provided, `atp` will fall back to looking for `config.toml` in the TODO: - [ ] more descriptive error messages -- [ ] use spawing + channels instead of `select!` +- [ ] use spawning + channels instead of `select!` - [ ] on-the-fly config reload? - [ ] UDP proxying? diff --git a/src/main.rs b/src/main.rs index 0dc445f..44d3dd3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,9 +20,9 @@ async fn main() -> anyhow::Result<()> { let listener = TcpListener::bind(SocketAddr::new("0.0.0.0".parse()?, port)).await?; loop { let (stream, _) = listener.accept().await?; - let to_stream = TcpStream::connect(saddr).await?; tokio::spawn(async move { + let to_stream = TcpStream::connect(saddr).await?; proxy(stream, to_stream).await?; Ok::<(), anyhow::Error>(()) });