diff --git a/tests/communication.rs b/tests/communication.rs index d983d81..d72566a 100644 --- a/tests/communication.rs +++ b/tests/communication.rs @@ -30,7 +30,7 @@ async fn communication() { let (msg_tx, msg_rx) = futures::channel::oneshot::channel(); let f = async move { - let listener = TcpListener::bind("0.0.0.0:12345").await.unwrap(); + let listener = TcpListener::bind("127.0.0.1:12345").await.unwrap(); info!("Server ready"); con_tx.send(()).unwrap(); info!("Waiting on next connection"); @@ -45,7 +45,7 @@ async fn communication() { info!("Waiting for server to be ready"); con_rx.await.expect("Server not ready"); - let tcp = TcpStream::connect("0.0.0.0:12345") + let tcp = TcpStream::connect("127.0.0.1:12345") .await .expect("Failed to connect"); let url = "ws://localhost:12345/"; @@ -76,7 +76,7 @@ async fn split_communication() { let (msg_tx, msg_rx) = futures::channel::oneshot::channel(); let f = async move { - let listener = TcpListener::bind("0.0.0.0:12346").await.unwrap(); + let listener = TcpListener::bind("127.0.0.1:12346").await.unwrap(); info!("Server ready"); con_tx.send(()).unwrap(); info!("Waiting on next connection"); @@ -91,7 +91,7 @@ async fn split_communication() { info!("Waiting for server to be ready"); con_rx.await.expect("Server not ready"); - let tcp = TcpStream::connect("0.0.0.0:12346") + let tcp = TcpStream::connect("127.0.0.1:12346") .await .expect("Failed to connect"); let url = url::Url::parse("ws://localhost:12345/").unwrap(); diff --git a/tests/handshakes.rs b/tests/handshakes.rs index 4d4c24a..3cd607c 100644 --- a/tests/handshakes.rs +++ b/tests/handshakes.rs @@ -7,7 +7,7 @@ async fn handshakes() { let (tx, rx) = futures::channel::oneshot::channel(); let f = async move { - let listener = TcpListener::bind("0.0.0.0:12345").await.unwrap(); + let listener = TcpListener::bind("127.0.0.1:12345").await.unwrap(); tx.send(()).unwrap(); while let Ok((connection, _)) = listener.accept().await { let stream = accept_async(connection).await; @@ -18,7 +18,7 @@ async fn handshakes() { task::spawn(f); rx.await.expect("Failed to wait for server to be ready"); - let tcp = TcpStream::connect("0.0.0.0:12345") + let tcp = TcpStream::connect("127.0.0.1:12345") .await .expect("Failed to connect"); let url = url::Url::parse("ws://localhost:12345/").unwrap();