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

#6 in #public-ip

Download history 34/week @ 2025-10-09 50/week @ 2025-10-16 55/week @ 2025-10-23 7/week @ 2025-10-30 16/week @ 2025-11-06 26/week @ 2025-11-13 44/week @ 2025-11-20 33/week @ 2025-11-27 34/week @ 2025-12-04 45/week @ 2025-12-11 55/week @ 2025-12-18 69/week @ 2025-12-25 42/week @ 2026-01-01 61/week @ 2026-01-08 52/week @ 2026-01-15 48/week @ 2026-01-22

203 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

~20–35MB
~486K SLoC