A simple library to get your public IP address.
Add this to your Cargo.toml
:
toml
[dependencies]
public-ip-addr = "0.1"
```rust use publicipaddr::getpublicip;
async fn main() { let ip = getpublicip().await.unwrap(); println!("Your public IP is: {}", ip); } ```