#ip-address #ip #public-ip #address #public #networking #web

bin+lib public-ip-addr

A simple library for getting your public IP address

1 unstable release

0.1.0 Jan 30, 2023

#17 in #public-ip


Used in cargo-nebular-setup

MIT license

18KB

public-ip-addr

License: MIT

A simple library to get your public IP address.

Usage

Add this to your Cargo.toml:

[dependencies]
public-ip-addr = "0.1"

Example

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);
}

Dependencies

~21–35MB
~633K SLoC