Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Rust
  3. tungstenite-rs

tungstenite-rs

Apache-2.0Rust

A lightweight, stream-based WebSocket implementation for Rust, providing a complete RFC6455 protocol implementation.

GitHubGitHub
2.4k stars290 forks0 contributors

What is tungstenite-rs?

Tungstenite is a lightweight, stream-based WebSocket implementation for Rust that provides a complete RFC6455 protocol implementation. It enables developers to build reliable networking applications using WebSockets, abstracting protocol details while allowing integration with custom event loops. The library supports both synchronous and asynchronous usage, with optional TLS for secure connections.

Target Audience

Rust developers building low-level networking applications, custom event loops, or foundational WebSocket-based services that require protocol correctness and flexibility without a specific async runtime.

Value Proposition

Developers choose Tungstenite for its minimal, reliable core WebSocket implementation that passes the Autobahn Test Suite, offers TLS support, and integrates easily with third-party event loops like MIO, serving as a trusted foundation for higher-level abstractions.

Overview

Lightweight stream-based WebSocket implementation for Rust.

Use Cases

Best For

  • Building custom WebSocket servers or clients in Rust without a specific async runtime
  • Integrating WebSocket functionality into existing MIO or custom event loops
  • Implementing low-level networking protocols that require RFC6455 compliance
  • Creating foundational libraries or frameworks that need a reliable WebSocket base
  • Developing applications requiring TLS-secured WebSocket connections with flexibility
  • Testing WebSocket implementations against the Autobahn Test Suite

Not Ideal For

  • Projects requiring built-in async runtime support like Tokio or async-std for seamless async/await patterns
  • Applications that need WebSocket compression (permessage-deflate) to reduce bandwidth usage
  • Teams looking for a high-level, opinionated framework with pre-built client/server abstractions for rapid development

Pros & Cons

Pros

Complete Protocol Implementation

Fully compliant with RFC6455 and passes the Autobahn Test Suite, ensuring reliable WebSocket communication as stated in the README.

Flexible Stream Integration

Works with synchronous streams like TcpStream and can be embedded in custom event loops such as MIO, offering control over network handling without imposing a runtime.

Optional TLS Support

Supports secure connections via features for native-tls or rustls, allowing choice based on platform needs, though no TLS feature is activated by default.

Minimal and Reliable Core

Serves as a foundational building block for higher-level libraries like tokio-tungstenite, prioritizing protocol correctness without unnecessary bloat.

Cons

No Compression Support

Lacks permessage-deflate implementation, which the README admits is missing and could limit bandwidth-sensitive applications.

Barebones API

Requires more manual code for common tasks like async integration, as it doesn't include higher-level abstractions, making setup more complex for some use cases.

Manual Async Handling

While flexible, integrating with async runtimes requires additional effort and boilerplate compared to dedicated async libraries like tokio-tungstenite.

Frequently Asked Questions

Quick Stats

Stars2,387
Forks290
Contributors0
Open Issues32
Last commit1 month ago
CreatedSince 2017

Tags

#tls#websocket#low-level#protocol-implementation#rust#networking#websockets

Built With

n
native-tls
R
Rust
r
rustls

Included in

Rust56.6k
Auto-fetched 8 hours ago

Related Projects

tokio/axumtokio/axum

HTTP routing and request-handling library for Rust that focuses on ergonomics and modularity

Stars27,052
Forks1,476
Last commit10 hours ago
RocketRocket

A web framework for Rust.

Stars25,781
Forks1,637
Last commit8 months ago
actix-webactix-web

Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust.

Stars24,824
Forks1,882
Last commit9 hours ago
LeptosLeptos

Build fast web applications with Rust.

Stars21,265
Forks894
Last commit3 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub