{"id":43564883,"url":"https://github.com/jiftechnify/wstd-tungstenite","last_synced_at":"2026-02-03T21:18:16.733Z","repository":{"id":332339309,"uuid":"1111764352","full_name":"jiftechnify/wstd-tungstenite","owner":"jiftechnify","description":"WebSocket support for wstd, powered by tungstenite","archived":false,"fork":false,"pushed_at":"2026-01-13T01:27:57.000Z","size":42,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-13T15:03:53.992Z","etag":null,"topics":[],"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/jiftechnify.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-07T15:40:28.000Z","updated_at":"2025-12-11T12:18:50.000Z","dependencies_parsed_at":"2026-01-13T15:03:59.925Z","dependency_job_id":null,"html_url":"https://github.com/jiftechnify/wstd-tungstenite","commit_stats":null,"previous_names":["jiftechnify/wstd-tungstenite"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/jiftechnify/wstd-tungstenite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiftechnify%2Fwstd-tungstenite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiftechnify%2Fwstd-tungstenite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiftechnify%2Fwstd-tungstenite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiftechnify%2Fwstd-tungstenite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jiftechnify","download_url":"https://codeload.github.com/jiftechnify/wstd-tungstenite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiftechnify%2Fwstd-tungstenite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29057411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T20:13:53.544Z","status":"ssl_error","status_checked_at":"2026-02-03T20:13:40.507Z","response_time":96,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-02-03T21:18:11.511Z","updated_at":"2026-02-03T21:18:16.721Z","avatar_url":"https://github.com/jiftechnify.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wstd-tungstenite\n\nAsync WebSocket support for Wasm / WASI 0.2 applications on top of [wstd].\n\n[![Crates.io](https://img.shields.io/crates/v/wstd-tungstenite)](https://crates.io/crates/wstd-tungstenite)\n[![Docs.rs](https://img.shields.io/docsrs/wstd-tungstenite)](https://docs.rs/wstd-tungstenite)\n[![MIT Licensed](https://img.shields.io/crates/l/wstd-tungstenite)](./LICENSE)\n\n[wstd]: https://github.com/bytecodealliance/wstd\n\n## Installation\n\n```bash\ncargo add wstd-tungstenite\n\n# Provides extension methods for Stream/Sink\n# You may want to add this for ergonomic WebSocketStream operations!\ncargo add futures\n```\n\n## Example\n\nMinimal WebSocket echo server:\n\n```rust\n// src/main.rs\n\nuse futures::{SinkExt, StreamExt};\nuse wstd::{io, iter::AsyncIterator, net::TcpListener};\nuse wstd_tungstenite::{accept_async, tungstenite::Message};\n\n#[wstd::main]\nasync fn main() -\u003e io::Result\u003c()\u003e {\n    let listener = TcpListener::bind(\"127.0.0.1:8080\").await?;\n    println!(\"Listening on {}\", listener.local_addr()?);\n\n    let mut incoming = listener.incoming();\n    while let Some(stream) = incoming.next().await {\n        let stream = stream?;\n        println!(\"Connection from {}\", stream.peer_addr()?);\n\n        let mut ws = accept_async(stream)\n            .await\n            .expect(\"Error during the websocket handshake occurred\");\n\n        wstd::runtime::spawn(async move {\n            while let Some(msg) = ws.next().await {\n                if let Ok(msg) = msg {\n                    println!(\"received: {msg}\");\n                    if msg.is_text() \u0026\u0026 ws.send(msg).await.is_err() {\n                        break;\n                    }\n                } else {\n                    break;\n                }\n            }\n        })\n        .detach();\n    }\n    Ok(())\n}\n```\n\nBuild it, then run on [wasmtime]:\n\n```bash\ncargo build --target wasm32-wasip2\nwasmtime run -S inherit-network=y ./target/wasm32-wasip2/release/example.wasm\n```\n\n[wasmtime]: https://wasmtime.dev/\n\n## Credits\nThis crate is heavily inspired by [tokio-tungstenite] and [async-tungstenite] crates.\nIndeed, API is mostly same and much of the code is borrowed from them.\n\nAnd, of course, big thanks to original [tungstenite] works!\n\n[tokio-tungstenite]: https://github.com/snapview/tokio-tungstenite\n[async-tungstenite]: https://github.com/sdroege/async-tungstenite\n[tungstenite]: https://github.com/snapview/tungstenite-rs\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiftechnify%2Fwstd-tungstenite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjiftechnify%2Fwstd-tungstenite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiftechnify%2Fwstd-tungstenite/lists"}