$ tungstenite

v0.29.0MAJOR UPDATE

Lightweight stream-based WebSocket implementation

Downloads: 169.7M
Recent: 32.4M
Versions: 49
Updated: March 17, 2026

Latest Update Summary

Crate

Name: tungstenite New version: 0.29.0 Release date: 2026-03-17T15:28:15.557155Z

Crate readme

Short description Lightweight stream-based WebSocket implementation for Rust.

Long description This library provides an implementation of WebSockets, RFC6455. It allows for both synchronous (like TcpStream) and asynchronous usage and is easy to integrate into any third-party event loops including MIO. The API design abstracts away all the internals of the WebSocket protocol but still makes them accessible for those who want full control over the network.

Features • native-tls • native-tls-vendored • rustls-tls-native-roots • rustls-tls-webpki-roots

Code Examples WebSocket echo server

 use std::net::TcpListener;
use std::thread::spawn;
use tungstenite::accept;

fn main () {
    let server = TcpListener::bind("127.0.0.1:9001").unwrap();
    for stream in server.incoming() {
        spawn (move || {
            let mut websocket = accept(stream.unwrap()).unwrap();
            loop {
                let msg = websocket.read().unwrap();
                if msg.is_binary() || msg.is_text() {
                    websocket.send(msg).unwrap();
                }
            }
        });
    }
}

Linkshttps://crates.io/crates/tungstenitehttps://docs.rs/tungstenitehttps://github.com/snapview/tungstenitehttps://github.com/crossbario/autobahn-testsuitehttps://github.com/snapview/tungstenite-rs/issues

https://docs.rs/tungstenite/0.29.0

Release info

Release version: N/A

Release description N/A

Code Examples N/A

Minor update: 0.28.0 → 0.29.0

$ DOWNLOADS TREND

119.6M169.7M

$ VERSION HISTORY

v0.29.0March 17, 2026
v0.28.0September 24, 2025

$ LINKS

$ INSTALL

cargo add tungstenite

Or add to Cargo.toml: tungstenite = "0.29.0"