{"id":18616731,"url":"https://github.com/sile/stun_codec","last_synced_at":"2025-04-13T08:21:24.809Z","repository":{"id":32944840,"uuid":"146731354","full_name":"sile/stun_codec","owner":"sile","description":"Decoders and encoders for STUN (RFC 5389) and its extensions","archived":false,"fork":false,"pushed_at":"2024-04-03T09:57:44.000Z","size":184,"stargazers_count":29,"open_issues_count":0,"forks_count":17,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-24T11:54:52.494Z","etag":null,"topics":["rust","stun","turn"],"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/sile.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":"2018-08-30T10:05:44.000Z","updated_at":"2024-11-27T03:38:46.000Z","dependencies_parsed_at":"2024-06-21T14:19:40.244Z","dependency_job_id":"343bf370-3aca-4136-a351-52dae3e1f294","html_url":"https://github.com/sile/stun_codec","commit_stats":{"total_commits":109,"total_committers":8,"mean_commits":13.625,"dds":"0.17431192660550454","last_synced_commit":"0f05f42dbd513851e98f0bcd44942c5c9787b45a"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Fstun_codec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Fstun_codec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Fstun_codec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Fstun_codec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sile","download_url":"https://codeload.github.com/sile/stun_codec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681598,"owners_count":21144715,"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","stun","turn"],"created_at":"2024-11-07T03:37:44.391Z","updated_at":"2025-04-13T08:21:24.780Z","avatar_url":"https://github.com/sile.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"stun_codec\n===========\n[![stun_codec](https://img.shields.io/crates/v/stun_codec.svg)](https://crates.io/crates/stun_codec)\n[![Documentation](https://docs.rs/stun_codec/badge.svg)](https://docs.rs/stun_codec)\n[![Actions Status](https://github.com/sile/stun_codec/workflows/CI/badge.svg)](https://github.com/sile/stun_codec/actions)\n[![Coverage Status](https://coveralls.io/repos/github/sile/stun_codec/badge.svg?branch=master)](https://coveralls.io/github/sile/stun_codec?branch=master)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nEncoders and decoders for [STUN (RFC 5389)][RFC 5389] and its extensions.\n\n[Documentation](https://docs.rs/stun_codec)\n\n\nExamples\n--------\n\n```rust\nuse bytecodec::{DecodeExt, EncodeExt, Error};\nuse stun_codec::{Message, MessageClass, MessageDecoder, MessageEncoder, TransactionId};\nuse stun_codec::rfc5389::{attributes::Software, methods::BINDING, Attribute};\n\n// Creates a message\nlet mut message = Message::new(MessageClass::Request, BINDING, TransactionId::new([3; 12]));\nmessage.add_attribute(Attribute::Software(Software::new(\"foo\".to_owned())?));\n\n// Encodes the message\nlet mut encoder = MessageEncoder::new();\nlet bytes = encoder.encode_into_bytes(message.clone())?;\nassert_eq!(\n    bytes,\n    [\n        0, 1, 0, 8, 33, 18, 164, 66, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 128, 34, 0, 3,\n        102, 111, 111, 0\n    ]\n);\n\n// Decodes the message\nlet mut decoder = MessageDecoder::\u003cAttribute\u003e::new();\nlet decoded = decoder.decode_from_bytes(\u0026bytes)?.map_err(Error::from)?;\nassert_eq!(decoded.class(), message.class());\nassert_eq!(decoded.method(), message.method());\nassert_eq!(decoded.transaction_id(), message.transaction_id());\nassert!(decoded.attributes().eq(message.attributes()));\n```\n\n\nReferences\n----------\n\n- [RFC 5245 - Interactive Connectivity Establishment (ICE)][RFC 5245]\n- [RFC 5389 - Session Traversal Utilities for NAT (STUN)][RFC 5389]\n- [RFC 5769 - Test Vectors for Session Traversal Utilities for NAT (STUN)][RFC 5769]\n- [RFC 5780 - NAT Behavior Discovery Using Session Traversal Utilities for NAT][RFC 5780]\n- [RFC 8016 - Mobility with Traversal Using Relays around NAT (TURN)][RFC 8016]\n- [RFC 8656 - Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT (STUN)][RFC 8656]\n\n[RFC 5245]: https://tools.ietf.org/html/rfc5245\n[RFC 5389]: https://tools.ietf.org/html/rfc5389\n[RFC 5769]: https://tools.ietf.org/html/rfc5769\n[RFC 5780]: https://tools.ietf.org/html/rfc5780\n[RFC 8016]: https://tools.ietf.org/html/rfc8016\n[RFC 8656]: https://tools.ietf.org/html/rfc8656\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsile%2Fstun_codec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsile%2Fstun_codec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsile%2Fstun_codec/lists"}