33 releases

Uses old Rust 2015

0.9.2 Feb 15, 2022
0.9.1 Oct 15, 2019
0.9.0 Jul 29, 2019
0.8.0 Feb 21, 2019
0.3.1 Nov 10, 2015

⚠️ Issues reported

#208 in WebSocket

Download history 3476/week @ 2023-12-15 1871/week @ 2023-12-22 1470/week @ 2023-12-29 1958/week @ 2024-01-05 2851/week @ 2024-01-12 2229/week @ 2024-01-19 2012/week @ 2024-01-26 1476/week @ 2024-02-02 2639/week @ 2024-02-09 2598/week @ 2024-02-16 2505/week @ 2024-02-23 2142/week @ 2024-03-01 2710/week @ 2024-03-08 2281/week @ 2024-03-15 2706/week @ 2024-03-22 2319/week @ 2024-03-29

10,479 downloads per month
Used in fewer than 55 crates

MIT license

235KB
5K SLoC

WS-RS

Lightweight, event-driven WebSockets for Rust.


/// A WebSocket echo server
listen("127.0.0.1:3012", |out| {
    move |msg| {
        out.send(msg)
    }
})

Introduction

Build Status MIT licensed

Homepage

API Documentation

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.

Getting Started

Check out the examples.

Features

WS-RS provides a complete implementation of the WebSocket specification. There is also support for ssl and permessage-deflate.

Contributing

Please report bugs and make feature requests here.

Dependencies

~3–15MB
~208K SLoC