rerun-io/ewebsock

A Rust Websocket client that compiles to both native and web

300

stars

69

commits

Rust

primary language

Sep 10, 2026

updated

rust
websocket

README

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 options = ewebsock::Options::default();
// see documentation for more options
let (mut sender, receiver) = ewebsock::connect("ws://example.com", options).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 library with:

# native mode
cargo run -p example_app

# web mode
# install trunk with `cargo install trunk` - https://trunk-rs.github.io/trunk/
(cd example_app && trunk serve)

Contributors

emilk

53 commits

c-git

6 commits

Its-Just-Nans

3 commits

lucasmerlin

1 commits

rerun-io/ewebsock

A Rust Websocket client that compiles to both native and web

300

stars

69

commits

Rust

primary language

Sep 10, 2026

updated

rust
websocket

README

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 options = ewebsock::Options::default();
// see documentation for more options
let (mut sender, receiver) = ewebsock::connect("ws://example.com", options).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 library with:

# native mode
cargo run -p example_app

# web mode
# install trunk with `cargo install trunk` - https://trunk-rs.github.io/trunk/
(cd example_app && trunk serve)

Contributors

emilk

53 commits

c-git

6 commits

Its-Just-Nans

3 commits

lucasmerlin

1 commits

Languages

Rust

67.5%

Python

21.9%

HTML

7.9%

Shell

1.7%