ws-tool
an easy to use websocket tool.
features:
- support tls & self signed cert
- support setting http proxy & socks5 proxy
- tested by autobahn
usage
basic usage
use ;
let mut client = new.proxy.build.await.unwrap;
client.connect.await.unwrap;
client.read_frame.await.unwrap;
self signed cert
examples/echo show how to connect to a websocket with self signed cert.
to run this example, first running gen_cert
example to get cert & key for testing
HGGhdKaBYHxoAiEAy8WuKhwxNj4rjLT4wzItTTQmfjtajILO1h3qkTvJRrs=
save cert as target.pem and key as target-key.pem under scripts
dir.
Then edit your /etc/hosts
, add dns record for wsl.com
domain, after that,
run scripts/ssl_server.py to setup a websocket server.
now you can connect websocket server with following command
use proxy
examples/binance show how to connect via proxy
run autobaha testsuit
start test server
run test on other terminal
report files should be under test_reports
dir.
autobahn test report
TODO
- add proxy auth config
- support custom https proxy cert
- split client into writer & reader