{"id":19958258,"url":"https://github.com/lerouxrgd/datachannel-rs","last_synced_at":"2025-10-07T08:07:21.010Z","repository":{"id":38834583,"uuid":"268864317","full_name":"lerouxrgd/datachannel-rs","owner":"lerouxrgd","description":"Rust wrappers for libdatachannel","archived":false,"fork":false,"pushed_at":"2025-04-13T19:01:24.000Z","size":265,"stargazers_count":143,"open_issues_count":0,"forks_count":30,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-10-04T02:51:31.573Z","etag":null,"topics":["datachannel","p2p","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":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lerouxrgd.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}},"created_at":"2020-06-02T17:22:18.000Z","updated_at":"2025-09-27T07:44:38.000Z","dependencies_parsed_at":"2024-12-14T10:02:29.847Z","dependency_job_id":"4a6d33b3-2428-4fdf-908b-e62ff24c6526","html_url":"https://github.com/lerouxrgd/datachannel-rs","commit_stats":{"total_commits":117,"total_committers":10,"mean_commits":11.7,"dds":0.1282051282051282,"last_synced_commit":"4e56f0a7fdae00a20de10038db9301d4cffecded"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"purl":"pkg:github/lerouxrgd/datachannel-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lerouxrgd%2Fdatachannel-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lerouxrgd%2Fdatachannel-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lerouxrgd%2Fdatachannel-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lerouxrgd%2Fdatachannel-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lerouxrgd","download_url":"https://codeload.github.com/lerouxrgd/datachannel-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lerouxrgd%2Fdatachannel-rs/sbom","scorecard":{"id":585543,"data":{"date":"2025-08-11","repo":{"name":"github.com/lerouxrgd/datachannel-rs","commit":"65e6f077001ecdc03deae21910234f253bcc53a6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Code-Review","score":1,"reason":"Found 3/25 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci-dynamic.yaml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/lerouxrgd/datachannel-rs/ci-dynamic.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci-static.yaml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/lerouxrgd/datachannel-rs/ci-static.yaml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci-dynamic.yaml:1","Warn: no topLevel permission defined: .github/workflows/ci-static.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Mozilla Public License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T20:24:47.620Z","repository_id":38834583,"created_at":"2025-08-20T20:24:47.620Z","updated_at":"2025-08-20T20:24:47.620Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278739972,"owners_count":26037476,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["datachannel","p2p","rust","webrtc"],"created_at":"2024-11-13T01:41:39.710Z","updated_at":"2025-10-07T08:07:20.973Z","avatar_url":"https://github.com/lerouxrgd.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# datachannel-rs \u0026emsp; [![latest]][crates.io] [![doc]][docs.rs]\n\n[latest]: https://img.shields.io/crates/v/datachannel.svg\n[crates.io]: https://crates.io/crates/datachannel\n[doc]: https://docs.rs/datachannel/badge.svg\n[docs.rs]: https://docs.rs/datachannel\n\nRust wrappers for [libdatachannel][], a WebRTC Data Channels standalone implementation in C++.\n\n## Usage\n\nThis crate provides two traits that end user must implement, `DataChannelHandler` and\n`PeerConnectionHandler`, which defined all callbacks for `RtcPeerConnection` and\n`RtcDataChannel` structs respectively.\n\nAforementioned traits are defined as follows:\n\n```rust\npub trait DataChannelHandler {\n    fn on_open(\u0026mut self) {}\n    fn on_closed(\u0026mut self) {}\n    fn on_error(\u0026mut self, err: \u0026str) {}\n    fn on_message(\u0026mut self, msg: \u0026[u8]) {}\n    fn on_buffered_amount_low(\u0026mut self) {}\n    fn on_available(\u0026mut self) {}\n}\n\npub trait PeerConnectionHandler {\n    type DCH;\n\n    fn data_channel_handler(\u0026mut self, info: DataChannelInfo) -\u003e Self::DCH;\n\n    fn on_description(\u0026mut self, sess_desc: SessionDescription) {}\n    fn on_candidate(\u0026mut self, cand: IceCandidate) {}\n    fn on_connection_state_change(\u0026mut self, state: ConnectionState) {}\n    fn on_gathering_state_change(\u0026mut self, state: GatheringState) {}\n    fn on_data_channel(\u0026mut self, data_channel: Box\u003cRtcDataChannel\u003cSelf::DCH\u003e\u003e) {}\n}\n```\n\nNote that all `on_*` methods have a default no-operation implementation.\n\nThe main struct, `RtcPeerconnection`, takes a `RtcConfig` (which defines ICE servers)\nand a instance of `PeerConnectionHandler`.\n\nHere is the basic workflow:\n\n```rust\nuse datachannel::{DataChannelHandler, DataChannelInfo, PeerConnectionHandler, RtcConfig, RtcPeerConnection};\n\nstruct MyChannel;\n\nimpl DataChannelHandler for MyChannel {\n    fn on_open(\u0026mut self) {\n        // TODO: notify that the data channel is ready (optional)\n    }\n\n    fn on_message(\u0026mut self, msg: \u0026[u8]) {\n        // TODO: process the received message\n    }\n}\n\nstruct MyConnection;\n\nimpl PeerConnectionHandler for MyConnection {\n    type DCH = MyChannel;\n\n    /// Used to create the `RtcDataChannel` received through `on_data_channel`.\n    fn data_channel_handler(\u0026mut self, _info: DataChannelInfo) -\u003e Self::DCH {\n        MyChannel\n    }\n\n    fn on_data_channel(\u0026mut self, mut dc: Box\u003cRtcDataChannel\u003cSelf::DCH\u003e\u003e) {\n        // TODO: store `dc` to keep receiving its messages (otherwise it will be dropped)\n    }\n}\n\nlet ice_servers = vec![\"stun:stun.l.google.com:19302\"];\nlet conf = RtcConfig::new(\u0026ice_servers);\n\nlet mut pc = RtcPeerConnection::new(\u0026conf, MyConnection)?;\n\nlet mut dc = pc.create_data_channel(\"test-dc\", MyChannel)?;\n// TODO: exchange `SessionDescription` and `IceCandidate` with remote peer\n// TODO: wait for `dc` to be opened (should be signaled through `on_open`)\n// ...\n// Then send a message\ndc.send(\"Hello Peer!\".as_bytes())?;\n```\n\nComplete implementation example can be found in the [tests](tests).\n\nSee also [async-datachannel][] for an async-based implementation.\n\n## Cargo features\n\n- **log** (_default_) Enables logging provided by the `log` crate (mutually exclusive with\n  **tracing**).\n- **tracing** Enables logging provided by the `tracing` crate (mutally exclusive with\n  **log**).\n- **vendored** Builds libdatachannel and its dependencies statically and bundles them in\n  the build (including `OpenSSL`).\n- **media** Enables media support through `libdatachannel`.\n\n## Building\n\nNote that `CMake` is required to compile [libdatachannel][] through\n[datachannel-sys](datachannel-sys).\n\n### Apple macOS\n\nYou probably need to set the following environment variables if your build fails with an\n`OpenSSL` related error.\n\n```sh\nexport OPENSSL_ROOT_DIR=/usr/local/opt/openssl@3\nexport OPENSSL_LIBRARIES=/usr/local/opt/openssl@3/lib\n```\n\nWith the paths of your local `OpenSSL` installation.\n\n### Ubuntu\n\nRequired dependencies:\n\n```sh\n# Needed to compile libdatachannel\nsudo apt install build-essential cmake pkg-config libssl-dev clang\n```\n\n[libdatachannel]: https://github.com/paullouisageneau/libdatachannel\n[async-datachannel]: https://github.com/wngr/async-datachannel\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flerouxrgd%2Fdatachannel-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flerouxrgd%2Fdatachannel-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flerouxrgd%2Fdatachannel-rs/lists"}