From 952681ed06b78a9ced5aff305e69e691eb13de88 Mon Sep 17 00:00:00 2001 From: Remalloc Date: Wed, 30 Nov 2022 19:57:50 +0800 Subject: [PATCH] Fix the unreachable test url --- examples/async-std-echo.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/async-std-echo.rs b/examples/async-std-echo.rs index 99502ca..a088f38 100644 --- a/examples/async-std-echo.rs +++ b/examples/async-std-echo.rs @@ -5,12 +5,16 @@ use async_std::task; async fn run() -> Result<(), Box> { #[cfg(any(feature = "async-tls", feature = "async-native-tls"))] - let url = "wss://echo.websocket.org"; + let url = "wss://echo.websocket.events/.ws"; #[cfg(not(any(feature = "async-tls", feature = "async-native-tls")))] - let url = "ws://echo.websocket.org"; + let url = "ws://echo.websocket.events/.ws"; + println!("Connecting: \"{}\"", url); let (mut ws_stream, _) = connect_async(url).await?; + let msg = ws_stream.next().await.ok_or("didn't receive anything")??; + println!("Received: {:?}", msg); + let text = "Hello, World!"; println!("Sending: \"{}\"", text);