Crates.io | public-ip-addr |
lib.rs | public-ip-addr |
version | 0.1.0 |
source | src |
created_at | 2023-01-30 10:59:41.121453 |
updated_at | 2023-01-30 10:59:41.121453 |
description | A simple library for getting your public IP address |
homepage | |
repository | https://github.com/tsirysndr/public-ip-addr |
max_upload_size | |
id | 771666 |
size | 56,921 |
A simple library to get your public IP address.
Add this to your Cargo.toml
:
[dependencies]
public-ip-addr = "0.1"
use public_ip_addr::get_public_ip;
#[tokio::main]
async fn main() {
let ip = get_public_ip().await.unwrap();
println!("Your public IP is: {}", ip);
}