{"id":13875985,"url":"https://github.com/sdroege/async-tungstenite","last_synced_at":"2025-05-14T01:10:19.233Z","repository":{"id":41755580,"uuid":"221229519","full_name":"sdroege/async-tungstenite","owner":"sdroege","description":"Async binding for Tungstenite, the Lightweight stream-based WebSocket implementation","archived":false,"fork":false,"pushed_at":"2025-02-18T13:27:57.000Z","size":410,"stargazers_count":411,"open_issues_count":7,"forks_count":64,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-05T09:02:38.705Z","etag":null,"topics":["async","async-std","gio","glib","rust","tokio","tungstenite","websocket","websockets"],"latest_commit_sha":null,"homepage":null,"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/sdroege.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":"2019-11-12T13:52:27.000Z","updated_at":"2025-03-05T06:48:44.000Z","dependencies_parsed_at":"2023-12-31T10:31:02.380Z","dependency_job_id":"a8787787-2d9c-4275-821b-ca874ffb9323","html_url":"https://github.com/sdroege/async-tungstenite","commit_stats":{"total_commits":317,"total_committers":66,"mean_commits":4.803030303030303,"dds":0.6593059936908517,"last_synced_commit":"eae2efab040371dca659b06eec8a9e8a2fc093ed"},"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdroege%2Fasync-tungstenite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdroege%2Fasync-tungstenite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdroege%2Fasync-tungstenite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdroege%2Fasync-tungstenite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sdroege","download_url":"https://codeload.github.com/sdroege/async-tungstenite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248564512,"owners_count":21125407,"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":["async","async-std","gio","glib","rust","tokio","tungstenite","websocket","websockets"],"created_at":"2024-08-06T06:00:54.233Z","updated_at":"2025-04-12T11:45:32.366Z","avatar_url":"https://github.com/sdroege.png","language":"Rust","funding_links":[],"categories":["Rust","websocket"],"sub_categories":[],"readme":"# async-tungstenite\n\nAsynchronous WebSockets for [async-std](https://async.rs),\n[tokio](https://tokio.rs), [gio](https://gtk-rs.org) and any `std`\n`Future`s runtime.\n\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n[![Crates.io](https://img.shields.io/crates/v/async-tungstenite.svg?maxAge=2592000)](https://crates.io/crates/async-tungstenite)\n[![Build Status](https://github.com/sdroege/async-tungstenite/workflows/CI/badge.svg)](https://github.com/sdroege/async-tungstenite/actions?query=workflow%3ACI)\n\n[Documentation](https://docs.rs/async-tungstenite)\n\n## Usage\n\nAdd this in your `Cargo.toml`:\n\n```toml\n[dependencies]\nasync-tungstenite = \"*\"\n```\n\nTake a look at the `examples/` directory for client and server examples. You\nmay also want to get familiar with [async-std](https://async.rs/) or\n[tokio](https://tokio.rs) if you don't have any experience with it.\n\n## What is async-tungstenite?\n\nThis crate is based on [tungstenite](https://crates.io/crates/tungstenite)\nRust WebSocket library and provides async bindings and wrappers for it, so you\ncan use it with non-blocking/asynchronous `TcpStream`s from and couple it\ntogether with other crates from the async stack. In addition, optional\nintegration with various other crates can be enabled via feature flags\n\n * `async-tls`: Enables the `async_tls` module, which provides integration\n   with the [async-tls](https://crates.io/crates/async-tls) TLS stack and can\n   be used independent of any async runtime.\n * `async-std-runtime`: Enables the `async_std` module, which provides\n   integration with the [async-std](https://async.rs) runtime.\n * `async-native-tls`: Enables the additional functions in the `async_std`\n   module to implement TLS via\n   [async-native-tls](https://crates.io/crates/async-native-tls).\n * `tokio-runtime`: Enables the `tokio` module, which provides integration\n   with the [tokio](https://tokio.rs) runtime.\n * `tokio-native-tls`: Enables the additional functions in the `tokio` module to\n   implement TLS via [tokio-native-tls](https://crates.io/crates/tokio-native-tls).\n * `tokio-rustls-native-certs`: Enables the additional functions in the `tokio` \n   module to implement TLS via [tokio-rustls](https://crates.io/crates/tokio-rustls)\n   and uses native system certificates found with\n   [rustls-native-certs](https://github.com/rustls/rustls-native-certs).\n * `tokio-rustls-webpki-roots`: Enables the additional functions in the `tokio` \n   module to implement TLS via [tokio-rustls](https://crates.io/crates/tokio-rustls)\n   and uses the certificates [webpki-roots](https://github.com/rustls/webpki-roots)\n   provides.\n * `gio-runtime`: Enables the `gio` module, which provides integration with\n   the [gio](https://gtk-rs.org) runtime.\n\n## Messages vs Streaming\n\nWebSocket provides a message-oriented protocol, and this crate primarily\nsupports sending and receiving data in messages; protocols built on WebSocket\nare allowed to make message boundaries semantically significant. However, some\nusers of WebSocket may want to treat the socket as a continuous stream of\nbytes. If you know the other end does not place significance on message\nboundaries, and you want to process a stream of bytes without regard to those\nboundaries, you can use the `ByteReader` and `ByteWriter` types provided by\nthis crate.\n\n## Is it performant?\n\nIn essence, `async-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 `async-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## tokio-tungstenite\n\nOriginally this crate was created as a fork of\n[tokio-tungstenite](https://github.com/snapview/tokio-tungstenite) and ported\nto the traits of the [`futures`](https://crates.io/crates/futures) crate.\nIntegration into async-std, tokio and gio was added on top of that.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdroege%2Fasync-tungstenite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdroege%2Fasync-tungstenite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdroege%2Fasync-tungstenite/lists"}