Crates.io | ws |
lib.rs | ws |
version | 0.9.2 |
source | src |
created_at | 2015-08-28 23:32:01.719516 |
updated_at | 2022-02-15 17:36:16.932278 |
description | Lightweight, event-driven WebSockets for Rust. |
homepage | |
repository | https://github.com/housleyjk/ws-rs |
max_upload_size | |
id | 2947 |
size | 310,247 |
Lightweight, event-driven WebSockets for Rust.
/// A WebSocket echo server
listen("127.0.0.1:3012", |out| {
move |msg| {
out.send(msg)
}
})
This library provides an implementation of WebSockets, RFC6455 using MIO. It allows for handling multiple connections on a single thread, and even spawning new client connections on the same thread. This makes for very fast and resource efficient WebSockets. The API design abstracts away the menial parts of the WebSocket protocol and allows you to focus on application code without worrying about protocol conformance. However, it is also possible to get low-level access to individual WebSocket frames if you need to write extensions or want to optimize around the WebSocket protocol.
Check out the examples.
WS-RS provides a complete implementation of the WebSocket specification. There is also support for ssl and permessage-deflate.
Please report bugs and make feature requests here.