From e61362915dc19367bc96565609db2b0add3c1b75 Mon Sep 17 00:00:00 2001 From: "B.O.S.S" Date: Thu, 21 Apr 2022 06:17:14 +0200 Subject: [PATCH] Fix Windows cargo test (#35) --- src/server.rs | 2 +- tests/e2e_test.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server.rs b/src/server.rs index 7192bf7..f4a8b4f 100644 --- a/src/server.rs +++ b/src/server.rs @@ -84,7 +84,7 @@ impl Server { return Ok(()); } info!(?port, "new client"); - let listener = match TcpListener::bind(("::", port)).await { + let listener = match TcpListener::bind(("0.0.0.0", port)).await { Ok(listener) => listener, Err(_) => { warn!(?port, "could not bind to local port"); diff --git a/tests/e2e_test.rs b/tests/e2e_test.rs index bbf751f..958b154 100644 --- a/tests/e2e_test.rs +++ b/tests/e2e_test.rs @@ -26,7 +26,7 @@ async fn spawn_client(secret: Option<&str>) -> Result<(TcpListener, SocketAddr)> let listener = TcpListener::bind("localhost:0").await?; let local_port = listener.local_addr()?.port(); let client = Client::new("localhost", local_port, "localhost", 0, secret).await?; - let remote_addr = ([0, 0, 0, 0], client.remote_port()).into(); + let remote_addr = ([127, 0, 0, 1], client.remote_port()).into(); tokio::spawn(client.listen()); Ok((listener, remote_addr)) }