{"id":18616776,"url":"https://github.com/sile/rusturn","last_synced_at":"2025-08-13T11:52:26.697Z","repository":{"id":23421545,"uuid":"83458354","full_name":"sile/rusturn","owner":"sile","description":"A Rust Implementation of TURN server and client","archived":false,"fork":false,"pushed_at":"2024-02-23T01:05:25.000Z","size":135,"stargazers_count":105,"open_issues_count":2,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-01T23:47:29.492Z","etag":null,"topics":["asynchronous","rust","turn"],"latest_commit_sha":null,"homepage":null,"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":"2017-02-28T17:04:55.000Z","updated_at":"2024-04-07T12:05:57.000Z","dependencies_parsed_at":"2024-11-07T03:42:07.603Z","dependency_job_id":"0f709b17-60e5-4548-bbbc-eeccdb02213b","html_url":"https://github.com/sile/rusturn","commit_stats":{"total_commits":59,"total_committers":2,"mean_commits":29.5,"dds":"0.016949152542372836","last_synced_commit":"81e31011d9fb96a7015ee83b6e3dceb6219d0d7f"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Frusturn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Frusturn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Frusturn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Frusturn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sile","download_url":"https://codeload.github.com/sile/rusturn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247999861,"owners_count":21031046,"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":["asynchronous","rust","turn"],"created_at":"2024-11-07T03:37:51.606Z","updated_at":"2025-04-09T08:10:03.667Z","avatar_url":"https://github.com/sile.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"rusturn\n=======\n\n[![rusturn](https://img.shields.io/crates/v/rusturn.svg)](https://crates.io/crates/rusturn)\n[![Documentation](https://docs.rs/rusturn/badge.svg)](https://docs.rs/rusturn)\n[![Actions Status](https://github.com/sile/rusturn/workflows/CI/badge.svg)](https://github.com/sile/rusturn/actions)\n[![Coverage Status](https://coveralls.io/repos/github/sile/rusturn/badge.svg?branch=master)](https://coveralls.io/github/sile/rusturn?branch=master)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nA Rust implementation of [TURN][RFC 5766] server and client.\n\n[Documentation](https://docs.rs/rusturn)\n\n\nExamples\n--------\n\n```rust\nuse futures::Future;\nuse rustun::message::Request;\nuse rustun::transport::StunUdpTransporter;\nuse rusturn::auth::AuthParams;\nuse rusturn::transport::UdpOverTurnTransporter;\nuse stun_codec::{rfc5389, MessageDecoder, MessageEncoder};\n\nlet client_auth_params = AuthParams::new(\"foo\", \"bar\")?;\nlet server_auth_params =\n    AuthParams::with_realm_and_nonce(\"foo\", \"bar\", \"baz\", \"qux\")?;\n\n// STUN server (peer)\nlet stun_server = fibers_global::execute(rustun::server::UdpServer::start(\n    fibers_global::handle(),\n    \"127.0.0.1:0\".parse().unwrap(),\n    rustun::server::BindingHandler,\n))?;\nlet stun_server_addr = stun_server.local_addr();\nfibers_global::spawn(stun_server.map(|_| ()).map_err(|e| panic!(\"{}\", e)));\n\n// TURN server\nlet turn_server = fibers_global::execute(rusturn::server::UdpServer::start(\n    \"127.0.0.1:0\".parse().unwrap(),\n    server_auth_params,\n))?;\nlet turn_server_addr = turn_server.local_addr();\nfibers_global::spawn(turn_server.map_err(|e| panic!(\"{}\", e)));\n\n// TURN client\nlet turn_client = fibers_global::execute(rusturn::client::UdpClient::allocate(\n    turn_server_addr,\n    client_auth_params\n))?;\nlet transporter =\n    UdpOverTurnTransporter::\u003c_, MessageEncoder\u003c_\u003e, MessageDecoder\u003c_\u003e\u003e::new(turn_client);\n\n// STUN client (over TURN)\nlet stun_channel = rustun::channel::Channel::new(StunUdpTransporter::new(transporter));\nlet stun_client = rustun::client::Client::new(\u0026fibers_global::handle(), stun_channel);\n\n// BINDING request\nlet request = Request::\u003crfc5389::Attribute\u003e::new(rfc5389::methods::BINDING);\nlet response = fibers_global::execute(\n    stun_client.call(stun_server_addr, request)\n)?;\nassert!(response.is_ok(), \"{:?}\", response);\n```\n\nReferences\n----------\n\n- [RFC 5766: Traversal Using Relays around NAT (TURN)][RFC 5766]\n\n[RFC 5766]: https://tools.ietf.org/html/rfc5766\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsile%2Frusturn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsile%2Frusturn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsile%2Frusturn/lists"}