{"id":22384349,"url":"https://github.com/richardanaya/cyberdeck","last_synced_at":"2025-07-04T04:36:24.193Z","repository":{"id":45903470,"uuid":"417345463","full_name":"richardanaya/cyberdeck","owner":"richardanaya","description":"A library for easily creating WebRTC data channel connections in Rust","archived":false,"fork":false,"pushed_at":"2023-03-06T18:49:59.000Z","size":69,"stargazers_count":42,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-17T15:42:43.690Z","etag":null,"topics":["rust","webrtc"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/richardanaya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-15T02:30:29.000Z","updated_at":"2025-02-11T01:13:47.000Z","dependencies_parsed_at":"2022-07-18T04:46:36.983Z","dependency_job_id":null,"html_url":"https://github.com/richardanaya/cyberdeck","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/richardanaya/cyberdeck","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardanaya%2Fcyberdeck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardanaya%2Fcyberdeck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardanaya%2Fcyberdeck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardanaya%2Fcyberdeck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/richardanaya","download_url":"https://codeload.github.com/richardanaya/cyberdeck/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardanaya%2Fcyberdeck/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261997047,"owners_count":23242231,"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":["rust","webrtc"],"created_at":"2024-12-05T01:17:07.250Z","updated_at":"2025-07-04T04:36:24.160Z","avatar_url":"https://github.com/richardanaya.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://docs.rs/cyberdeck\"\u003e\u003cimg src=\"https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square\" alt=\"docs.rs docs\" /\u003e\u003c/a\u003e\n\n# Cyberdeck\nA library for easily creating WebRTC data channel connections in Rust.\n\n```toml\ncargo add cyberdeck\n```\n\n```rust\nlet mut peer = Peer::new(|peer_id, e| async move {\n    match e {\n        PeerEvent::DataChannelMessage(c, m) =\u003e {\n            println!(\n                \"{}::Recieved a message from channel {}!\",\n                peer_id,\n                c.label()\n            );\n            let msg_str = String::from_utf8(m.data.to_vec()).unwrap();\n            println!(\n                \"{}::Message from DataChannel '{}': {}\",\n                peer_id,\n                c.label(),\n                msg_str\n            );\n        }\n        PeerEvent::DataChannelStateChange(c) =\u003e {\n            if c.ready_state() == RTCDataChannelState::Open {\n                println!(\"{}::DataChannel '{}'\", peer_id, c.label());\n                c.send_text(\"Connected to client!\".to_string())\n                    .await\n                    .unwrap();\n            } else if c.ready_state() == RTCDataChannelState::Closed {\n                println!(\"{}::DataChannel '{}'\", peer_id, c.label());\n            }\n        }\n        PeerEvent::PeerConnectionStateChange(s) =\u003e {\n            println!(\"{}::Peer connection state: {} \", peer_id, s)\n        }\n    }\n})\n.await?;\nlet answer = peer.receive_offer(\u0026offer).await?;\n```\n\n# Signaling server\n\nWebRTC works in it's most basic form by having the client and server exchange strings that represent their networking information.  A signaling server is just some API that you exchange that information through. You can see a simple signaling server implemented with a single POST http handler here in this example [here](https://github.com/richardanaya/cyberdeck/blob/master/examples/signaling_server.rs).\n\n```bash\ncargo run --example signaling_server\n```\n\n# Art\n\n![Cyberpunk crab](https://user-images.githubusercontent.com/294042/222991163-9ef095eb-98da-419f-8f06-b1ea1d51f34d.png)\n\n# License\n\nThis project is licensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or\n   http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or\n   http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in `cyberdeck` by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichardanaya%2Fcyberdeck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frichardanaya%2Fcyberdeck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichardanaya%2Fcyberdeck/lists"}