{"id":15373016,"url":"https://github.com/vi/rust-stunclient","last_synced_at":"2025-04-11T12:51:14.698Z","repository":{"id":57668888,"uuid":"168614964","full_name":"vi/rust-stunclient","owner":"vi","description":"Simple Rust STUN client library for resolving external IP address and port of a UDP socket","archived":false,"fork":false,"pushed_at":"2024-05-21T14:35:22.000Z","size":29,"stargazers_count":19,"open_issues_count":2,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T09:11:18.431Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-01-31T23:52:40.000Z","updated_at":"2024-10-23T21:50:14.000Z","dependencies_parsed_at":"2024-10-16T13:00:54.331Z","dependency_job_id":"1f45b28d-2ca2-4e04-85fb-9811dab031c3","html_url":"https://github.com/vi/rust-stunclient","commit_stats":{"total_commits":26,"total_committers":4,"mean_commits":6.5,"dds":"0.15384615384615385","last_synced_commit":"ef35ef84347ce3a504c0f159c6b46c3e3234ecc5"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Frust-stunclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Frust-stunclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Frust-stunclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Frust-stunclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vi","download_url":"https://codeload.github.com/vi/rust-stunclient/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248008629,"owners_count":21032556,"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-01T13:54:06.726Z","updated_at":"2025-04-11T12:51:14.678Z","avatar_url":"https://github.com/vi.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Simple UDP-only STUN client for resolving external IP address:port behind NAT.\n\nSupports both sync and async.\n\nExample (sync):\n\n```rust\nuse std::net::UdpSocket;\nuse stunclient::StunClient;\nuse std::net::{SocketAddr,ToSocketAddrs};\nlet local_addr : SocketAddr = \"0.0.0.0:0\".parse().unwrap();\nlet stun_addr = \"stun.l.google.com:19302\".to_socket_addrs().unwrap().filter(|x|x.is_ipv4()).next().unwrap();\nlet udp = UdpSocket::bind(local_addr).unwrap();\n\nlet c = StunClient::new(stun_addr);\n\nlet my_external_addr = c.query_external_address(\u0026udp).unwrap();\n```\n\nExample (async):\n\n```rust\nuse stunclient::StunClient;\nuse std::net::{SocketAddr,ToSocketAddrs};\n\nlet local_addr : SocketAddr = \"0.0.0.0:0\".parse().unwrap();\nlet stun_addr = \"stun.l.google.com:19302\".to_socket_addrs().unwrap().filter(|x|x.is_ipv4()).next().unwrap();\nlet udp = tokio::net::udp::UdpSocket::bind(\u0026local_addr).unwrap();\n\nlet c = StunClient::new(stun_addr);\nlet f = c.query_external_address_async(\u0026udp);\nlet my_external_addr = f.await.unwrap();\n```\n\nOld version (0.1) of stunclient is almost the same, but is for Tokio `0.1`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvi%2Frust-stunclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvi%2Frust-stunclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvi%2Frust-stunclient/lists"}