Skip to content

A Rust Websocket client that compiles to both native and web

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

AngelOnFira/ewebsock

 
 

ewebsock

github Latest version Documentation unsafe forbidden Build Status MIT Apache

This is a simple WebSocket library for Rust which can be compiled to both native and web (WASM).

Usage

let (mut sender, receiver) = ewebsock::connect("ws://example.com").unwrap();
sender.send(ewebsock::WsMessage::Text("Hello!".into()));
while let Some(event) = receiver.try_recv() {
    println!("Received {:?}", event);
}

Testing

First start the example echo server with:

cargo r -p echo_server

Then test the native library with:

cargo run -p example_app

And the web library with:

./example_app/start_server.sh &
./example_app/build_web.sh --open

About

A Rust Websocket client that compiles to both native and web

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 69.7%
  • Python 22.8%
  • Shell 7.5%