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

#166 in WebSocket

Download history 2999/week @ 2023-08-12 2621/week @ 2023-08-19 2085/week @ 2023-08-26 2458/week @ 2023-09-02 3155/week @ 2023-09-09 2939/week @ 2023-09-16 1315/week @ 2023-09-23 1841/week @ 2023-09-30 2123/week @ 2023-10-07 2797/week @ 2023-10-14 2930/week @ 2023-10-21 3288/week @ 2023-10-28 3660/week @ 2023-11-04 3465/week @ 2023-11-11 3533/week @ 2023-11-18 3492/week @ 2023-11-25

14,777 downloads per month
Used in fewer than 54 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 Crate

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–14MB
~197K SLoC