Crates.io | getip |
lib.rs | getip |
version | 0.1.0 |
source | src |
created_at | 2024-07-25 14:08:38.561495 |
updated_at | 2024-07-25 14:08:38.561495 |
description | Find the public IP address of a device |
homepage | https://github.com/rexagon/getip |
repository | https://github.com/rexagon/getip |
max_upload_size | |
id | 1315067 |
size | 12,774 |
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
#[tokio::main]
async fn main() {
match getip::addr().await {
Ok(addr) => println!("My address is: {addr:?}"),
Err(e) => println!("Failed to resolve: {e:?}"),
}
}