tsirysndr / public-ip-addr

A simple Rust library to get your public IP address.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

A simple Rust library to get your public IP address.

License:MIT License


Languages

Language:Rust 100.0%