{"id":16603286,"url":"https://github.com/dbrgn/candidateparser","last_synced_at":"2025-07-17T06:05:42.167Z","repository":{"id":62438804,"uuid":"104104229","full_name":"dbrgn/candidateparser","owner":"dbrgn","description":"Parser for ICE Candidates SDP written in Rust. Includes C FFI as well as JNI bindings.","archived":false,"fork":false,"pushed_at":"2017-12-07T08:26:46.000Z","size":2429,"stargazers_count":31,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-15T06:50:10.805Z","etag":null,"topics":[],"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/dbrgn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-09-19T17:11:40.000Z","updated_at":"2024-10-26T17:55:50.000Z","dependencies_parsed_at":"2022-11-01T22:01:32.654Z","dependency_job_id":null,"html_url":"https://github.com/dbrgn/candidateparser","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/dbrgn/candidateparser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbrgn%2Fcandidateparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbrgn%2Fcandidateparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbrgn%2Fcandidateparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbrgn%2Fcandidateparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbrgn","download_url":"https://codeload.github.com/dbrgn/candidateparser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbrgn%2Fcandidateparser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265571366,"owners_count":23790049,"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":[],"created_at":"2024-10-12T00:48:57.335Z","updated_at":"2025-07-17T06:05:42.129Z","avatar_url":"https://github.com/dbrgn.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# candidateparser\n\n[![CircleCI](https://circleci.com/gh/dbrgn/candidateparser/tree/master.svg?style=shield)](https://circleci.com/gh/dbrgn/candidateparser/tree/master)\n[![Crates.io Version][crates-io-badge]][crates-io]\n[![Crates.io Downloads][crates-io-download-badge]][crates-io-download]\n[![Rust][rust-badge]][github]\n\nThis is a parser for the [ICE](https://tools.ietf.org/html/rfc5245) Candidate\nSDP, which is used for connectivity establishment and NAT traversal in\ncommunication systems like [WebRTC](https://webrtc.org/). Bindings for C and\nAndroid (through JNI) are provided. Building a universal library for iOS is\nalso possible.\n\nExample candidate SDP:\n\n    candidate:842163049 1 udp 1686052607 1.2.3.4 46154 typ srflx raddr 10.0.0.17 rport 46154 generation 0 ufrag EEtu network-id 3 network-cost 10\n\nIt will parse the data into a struct with all components. The example above\nwill result in the following object:\n\n    IceCandidate {\n        foundation: \"842163049\",\n        component_id: 1,\n        transport: Udp,\n        priority: 1686052607,\n        connection_address: V4(1.2.3.4),\n        port: 46154,\n        candidate_type: Srflx,\n        rel_addr: Some(V4(10.0.0.17)),\n        rel_port: Some(46154),\n        extensions: Some({\n            [110, 101, 116, 119, 111, 114, 107, 45, 99, 111, 115, 116]: [49, 48],\n            [103, 101, 110, 101, 114, 97, 116, 105, 111, 110]: [48],\n            [117, 102, 114, 97, 103]: [69, 69, 116, 117],\n            [110, 101, 116, 119, 111, 114, 107, 45, 105, 100]: [51]\n        })\n    }\n\nFor more information, see [RFC5245 (Interactive Connectivity Establishment (ICE))](https://tools.ietf.org/html/rfc5245).\n\nCrate docs: https://docs.rs/candidateparser/\n\nNote: Due to build system issues, Rust 1.21+ is required.\n\n\n## FFI (C/C++17)\n\nThis library includes C and C++17 bindings, so you can use it from any language\nthat supports the C calling convention. Example programs in C and C++17 can be\nfound in the `candidateparser-ffi/examples/` directory.\n\n\n## JNI bindings (Java / Android)\n\nThis library also contains JNI bindings, written with\n[jni-rs](https://github.com/prevoty/jni-rs). An Android library with a simple\ntest is provided in the `candidateparser-android` directory.\n\nMake sure to build the `candidateparser-jni` crate before building the Android library.\n\n### Building `candidateparser-jni` for Android\n\nRequirements:\n\n- Android NDK\n- Rustup\n- Make\n\nAdd rustup targets:\n\n    $ rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android\n\nBuild standalone toolchains:\n\n    $ ./create-ndk-standalone.sh\n\nAdd toolchain config to your `~/.cargo/config`:\n\n    $ cat cargo-config.toml \u003e\u003e ~/.cargo/config\n\nBuild Android libraries:\n\n    $ make android\n\n### Building the `candidateparser-android` library for Android\n\nBuild the library using gradle:\n\n    $ ./gradlew build\n\nYou will find the AAR file in the `app/build/outputs/aar/` directory.\n\n\n## Linting\n\nTo run clippy lints, compile the library with `--features clippy` on a nightly compiler:\n\n    $ cargo build --features clippy\n\nNote: Running this command from the workspace root won't work, you have to `cd`\ninto the sub-crates!\n\n\n## Universal iOS library\n\nIf you want to build a universal iOS library, install\n[cargo-lipo](https://github.com/TimNN/cargo-lipo). Then, delete the\n`Cargo.toml` file in the root (cargo-lipo cannot deal with workspaces\ncurrently).\n\n    $ rm Cargo.toml\n\nFinally, build the library:\n\n    $ make ios\n\nNote that this only works on macOS at the moment.\n\n\n## License\n\nLicensed 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) at your option.\n\n\n### Contributing\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n\n\n[crates-io]: https://crates.io/crates/candidateparser\n[crates-io-badge]: https://img.shields.io/crates/v/candidateparser.svg?maxAge=3600\n[crates-io-download]: https://crates.io/crates/candidateparser\n[crates-io-download-badge]: https://img.shields.io/crates/d/candidateparser.svg?maxAge=3600\n[github]: https://github.com/dbrgn/candidateparser\n[rust-badge]: https://img.shields.io/badge/rust-1.21%2B-blue.svg?maxAge=3600\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbrgn%2Fcandidateparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbrgn%2Fcandidateparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbrgn%2Fcandidateparser/lists"}