Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
T

tungstenite-rs

> 编程语言
Open source

Lightweight stream-based WebSocket implementation for Rust.

2.4K stars0 likes0 views
WebsiteGitHub

About

Lightweight stream-based WebSocket implementation for Rust.

Tungstenite

Lightweight stream-based WebSocket implementation for Rust.

…

Take a look at the examples section to see how to write a simple client/server.

NOTE: tungstenite-rs is more like a barebone to build reliable modern networking applications using WebSockets. If you're looking for a modern production-ready "batteries included" WebSocket library that allows you to efficiently use non-blocking sockets and do "full-duplex" communication, take a look at tokio-tungstenite. Documentation

Introduction

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 wants full control over the network.

Why Tungstenite?

It's formerly WS2, the 2nd implementation of WS. WS2 is the chemical formula of tungsten disulfide, the tungstenite mineral.

Features

Tungstenite provides a complete implementation of the WebSocket specification. TLS is supported on all platforms using native-tls or rustls. The following features are available:

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

Choose the one that is appropriate for your needs.

By default no TLS feature is activated, so make sure you use one of the TLS features, otherwise you won't be able to communicate with the TLS endpoints.

There is no support for permessage-deflate at the moment, but the PRs are welcome :wink:

Testing

Tungstenite is thoroughly tested and passes the Autobahn Test Suite for WebSockets. It is also covered by internal unit tests as well as possible.

Benchmark

Benches are in ./benches.

  • Run all with cargo bench --bench \* -- --quick --noplot
  • Run a particular set with, say "e2e", with cargo bench --bench e2e -- --quick --noplot

Contributing

Please report bugs and make feature requests here.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustrustwebsockets

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言