An easy to use websocket client/server toolkit, supporting blocking/async IO.
feature matrix
| IO type | proxy | tls | deflate | use as client | use as server | | -------- | ----- | --- | ------- | ------------- | ------------- | | blocking | 🚧wip | ✅ | 🚧wip | ✅ | ✅ | | async | ✅ | ✅ | 🚧wip | ✅ | ✅ |
It's tested by autobaha test suit. see examples/autobahn-client
pretty good performance
Roughly compare with EchoSever example, tungstenite, both async and blocking version of ws-tool echo serve win in single client(more then 10) with 1m payload size.
My test machine is i9-12900k and 32GB, 3200MHz ddr4, use uWebSocket provided client example as perf client
| server | ws-tool | ws-tool async | uWebSocket | tungstenite | | ------- | ------- | ------------- | ---------- | ----------- | | msg/sec | 5150± | 5150± | 3200± | 2850± |
Every example can be run with
bash
cargo run --example <example_name> --all-features
command.
See examples/server for building a websocket echo server with self signed certs.
examples/echo demonstrate how to connect to a wss server.
examples/binance show how to connect via proxy
start test server
bash
./script/start_autobahn_server.sh
run test on other terminal
bash
cargo run --example autobahn_client --all-features
report files should be under test_reports
dir.
click to expand report