{"id":13579333,"url":"https://github.com/snapview/tokio-tungstenite","last_synced_at":"2025-05-14T21:00:16.697Z","repository":{"id":37548870,"uuid":"85336768","full_name":"snapview/tokio-tungstenite","owner":"snapview","description":"Future-based Tungstenite for Tokio. Lightweight stream-based WebSocket implementation","archived":false,"fork":false,"pushed_at":"2025-02-18T11:21:34.000Z","size":260,"stargazers_count":2089,"open_issues_count":20,"forks_count":242,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-05-07T19:47:40.091Z","etag":null,"topics":["asynchronous","tokio","tokio-tungstenite","websocket","websockets"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/snapview.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-17T17:15:58.000Z","updated_at":"2025-05-07T18:45:03.000Z","dependencies_parsed_at":"2024-05-08T19:34:45.976Z","dependency_job_id":"73be26c3-9f5c-42dc-821c-24a9e6c4742e","html_url":"https://github.com/snapview/tokio-tungstenite","commit_stats":{"total_commits":264,"total_committers":61,"mean_commits":4.327868852459017,"dds":0.6704545454545454,"last_synced_commit":"0eefa27f196b65e43ac196f0ff2127a143b6873a"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snapview%2Ftokio-tungstenite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snapview%2Ftokio-tungstenite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snapview%2Ftokio-tungstenite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snapview%2Ftokio-tungstenite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snapview","download_url":"https://codeload.github.com/snapview/tokio-tungstenite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254049169,"owners_count":22006009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asynchronous","tokio","tokio-tungstenite","websocket","websockets"],"created_at":"2024-08-01T15:01:38.448Z","updated_at":"2025-05-14T21:00:16.324Z","avatar_url":"https://github.com/snapview.png","language":"Rust","funding_links":[],"categories":["Rust","Tools per Language"],"sub_categories":["Rust"],"readme":"# tokio-tungstenite\n\nAsynchronous WebSockets for Tokio stack.\n\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n[![Crates.io](https://img.shields.io/crates/v/tokio-tungstenite.svg?maxAge=2592000)](https://crates.io/crates/tokio-tungstenite)\n[![Build Status](https://travis-ci.org/snapview/tokio-tungstenite.svg?branch=master)](https://travis-ci.org/snapview/tokio-tungstenite)\n\n[Documentation](https://docs.rs/tokio-tungstenite)\n\n## Usage\n\nAdd this in your `Cargo.toml`:\n\n```toml\n[dependencies]\ntokio-tungstenite = \"*\"\n```\n\nTake a look at the `examples/` directory for client and server examples. You may also want to get familiar with\n[Tokio](https://github.com/tokio-rs/tokio) if you don't have any experience with it.\n\n## What is tokio-tungstenite?\n\nThis crate is based on [`tungstenite-rs`](https://github.com/snapview/tungstenite-rs) Rust WebSocket library and provides `Tokio` bindings and wrappers for it, so you\ncan use it with non-blocking/asynchronous `TcpStream`s from and couple it together with other crates from `Tokio` stack.\n\n## Features\n\nAs with [`tungstenite-rs`](https://github.com/snapview/tungstenite-rs) TLS is supported on all platforms using [`native-tls`](https://github.com/sfackler/rust-native-tls) or [`rustls`](https://github.com/ctz/rustls) through feature flags: `native-tls`, `rustls-tls-native-roots` or `rustls-tls-webpki-roots` feature flags. Neither is enabled by default. See the `Cargo.toml` for more information. If you require support for secure WebSockets (`wss://`) enable one of them.\n\nNote, that if you're using `rustls` features with `tokio-tungstenite` [version `0.23.0`](https://github.com/snapview/tokio-tungstenite/blob/master/CHANGELOG.md#0230) or higher,\nyou [might observe a panic](https://github.com/snapview/tokio-tungstenite/issues/336) that is easy to fix (see the issue). Check [the discussion](https://github.com/snapview/tokio-tungstenite/issues/353#issuecomment-2455100010)\nfor more details.\n\n## Is it performant?\n\nIn essence, `tokio-tungstenite` is a wrapper for `tungstenite`, so the performance is capped by the performance of `tungstenite`. `tungstenite`\nhas a decent performance (it has been used in production for real-time communication software, video conferencing, etc), but it's definitely\nnot the fastest WebSocket library in the world at the moment of writing this note.\n\nIf performance is of a paramount importance for you (especially if you send **large messages**), then you might want to check other libraries\nthat have been designed to be performant or you could file a PR against `tungstenite` to improve the performance!\n\nWe are aware of changes that both `tungstenite` and `tokio-tungstenite` need in order to fill the gap of ~30% performance difference between `tungstenite`\nand more performant libraries like `fastwebsockets`, but we have not worked on that yet as it was not required for the use case that original authors designed\nthe library for. In the course of past years we have merged several performance improvements submitted by the awesome community of Rust users who helped to improve\nthe library! For a quick summary of the pending performance problems/improvements, see [the comment](https://github.com/snapview/tungstenite-rs/issues/352#issuecomment-1537488614).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnapview%2Ftokio-tungstenite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnapview%2Ftokio-tungstenite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnapview%2Ftokio-tungstenite/lists"}