Fix the unreachable test url

This commit is contained in:
Remalloc 2022-11-30 19:57:50 +08:00 committed by Sebastian Dröge
parent 86556189e3
commit 952681ed06
1 changed files with 6 additions and 2 deletions

View File

@ -5,12 +5,16 @@ use async_std::task;
async fn run() -> Result<(), Box<dyn std::error::Error>> {
#[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);