https://github.com/snapview/tokio-tungstenite
see examples: https://github.com/snapview/tokio-tungstenite/tree/master/examples
Stream / Sink 这两个核心抽象从 docs.rs
echo server
ws server echo what client send
cli client
read message for client stdin, and send to ws server. print this message in server cli
server (主动) push,
不等客户端先发
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