tokio-websockets 0.3.3

High performance, strict, tokio-util based websockets implementation
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use http::Uri;
use tokio_websockets::{ClientBuilder, Error};

#[tokio::main]
async fn main() -> Result<(), Error> {
    let uri = Uri::from_static("wss://gateway.discord.gg");
    let mut client = ClientBuilder::from_uri(uri).connect().await?;

    while let Some(item) = client.next().await {
        println!("{item:?}");
    }

    Ok(())
}