https://github.com/snapview/tokio-tungstenite

see examples: https://github.com/snapview/tokio-tungstenite/tree/master/examples

  1. 先理解它到底是什么
  2. 再跑最小 client / server
  3. 再学 Stream / Sink 这两个核心抽象
  4. 最后再看握手、header、TLS、心跳、拆分读写这些进阶点

docs.rs


todo


Practice

cargo new rust-websocket
cd rust-websocket
cargo add tokio --features full
cargo add tokio-tungstenite
cargo add futures-util
cargo add anyhow
cargo add futures-channel log env_logger