{"id":33931749,"url":"https://github.com/zephyrchien/lightws","last_synced_at":"2026-04-08T13:31:15.288Z","repository":{"id":37029691,"uuid":"471058917","full_name":"zephyrchien/lightws","owner":"zephyrchien","description":"Lightweight websocket implement for stream transmission.","archived":false,"fork":false,"pushed_at":"2025-08-02T17:39:52.000Z","size":157,"stargazers_count":31,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-02T10:55:57.700Z","etag":null,"topics":["network","rust","websocket"],"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/zephyrchien.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}},"created_at":"2022-03-17T16:29:15.000Z","updated_at":"2025-09-23T04:55:09.000Z","dependencies_parsed_at":"2024-09-16T20:27:02.590Z","dependency_job_id":null,"html_url":"https://github.com/zephyrchien/lightws","commit_stats":{"total_commits":62,"total_committers":2,"mean_commits":31.0,"dds":"0.016129032258064502","last_synced_commit":"20682beb85d23bea3bdb774ce82bbbffa77bafdd"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/zephyrchien/lightws","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephyrchien%2Flightws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephyrchien%2Flightws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephyrchien%2Flightws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephyrchien%2Flightws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zephyrchien","download_url":"https://codeload.github.com/zephyrchien/lightws/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephyrchien%2Flightws/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31558380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T10:21:54.569Z","status":"ssl_error","status_checked_at":"2026-04-08T10:21:38.171Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["network","rust","websocket"],"created_at":"2025-12-12T12:58:47.877Z","updated_at":"2026-04-08T13:31:15.275Z","avatar_url":"https://github.com/zephyrchien.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lightws\n\n![Lightws](https://github.com/zephyrchien/lightws/workflows/ci/badge.svg)\n![Lightws](https://github.com/zephyrchien/lightws/workflows/build/badge.svg)\n[![Released API docs](https://docs.rs/lightws/badge.svg)](https://docs.rs/lightws)\n[![crates.io](https://img.shields.io/crates/v/lightws.svg)](https://crates.io/crates/lightws)\n\nLightweight websocket implement for stream transmission.\n\n## Features\n\n- Avoid heap allocation.\n- Avoid buffering frame payload.\n- Use vectored-io if available.\n- Transparent Read/Write over the underlying IO source.\n\n## High-level API\n\n[role, endpoint, stream]\n\nStd:\n\n```rust\n{\n    // handshake\n    let stream = Endpoint\u003cTcpStream, Client\u003e::connect(tcp, buf, host, path)?;\n    // read some data\n    stream.read(\u0026mut buf)?;\n    // write some data\n    stream.write(\u0026buf)?;\n}\n```\n\nAsync:\n\n```rust\n{\n    // handshake\n    let stream = Endpoint\u003cTcpStream, Client\u003e::connect_async(tcp, buf, host, path).await?;\n    // read some data\n    stream.read(\u0026mut buf).await?;\n    // write some data\n    stream.write(\u0026buf).await?;\n}\n```\n\n## Low-level API\n\n[frame, handshake]\n\nFrame:\n\n```rust\n{\n    // encode a frame head\n    let head = FrameHead::new(...);\n    let offset = unsafe {\n        head.encode_unchecked(\u0026mut buf);\n    };\n\n    // decode a frame head\n    let (head, offset) = FrameHead::decode(\u0026buf).unwrap();\n}\n```\n\nHandshake:\n\n```rust\n{\n    // make a client handshake request\n    let request = Request::new(b\"/ws\", b\"example.com\", \"sec-key..\");\n    let offset = request.encode(\u0026mut buf).unwrap();\n\n    // parse a server handshake response\n    let mut custom_headers = HttpHeader::new_storage();\n    let mut response = Response::new_storage(\u0026mut custom_headers);\n    let offset = response.decode(\u0026buf).unwrap();\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzephyrchien%2Flightws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzephyrchien%2Flightws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzephyrchien%2Flightws/lists"}