3 unstable releases

Uses new Rust 2024

0.2.1 Jul 15, 2025
0.2.0 Jul 9, 2025
0.1.0 Jul 25, 2024

#8 in #public-ip

Download history 48/week @ 2026-01-22 53/week @ 2026-01-29 15/week @ 2026-02-05 16/week @ 2026-02-12 56/week @ 2026-02-19 39/week @ 2026-02-26 1100/week @ 2026-03-05 655/week @ 2026-03-12 561/week @ 2026-03-19 424/week @ 2026-03-26 587/week @ 2026-04-02 598/week @ 2026-04-09 449/week @ 2026-04-16 798/week @ 2026-04-23 539/week @ 2026-04-30 434/week @ 2026-05-07

2,317 downloads per month
Used in 5 crates (via tycho-util)

MIT license

13KB
299 lines

getip

A small crate to find the public IP address of a device.

Note

This crate is just an updated and minified version of https://github.com/avitex/rust-public-ip

Example

#[tokio::main]
async fn main() {
    match getip::addr().await {
        Ok(addr) => println!("My address is: {addr:?}"),
        Err(e) => println!("Failed to resolve: {e:?}"),
    }
}

Dependencies

~18–32MB
~447K SLoC