4 releases

0.1.3 Sep 2, 2019
0.1.2 Sep 2, 2019
0.1.1 Sep 2, 2019
0.1.0 Sep 2, 2019

#11 in #local-ip

Download history 1135/week @ 2025-12-08 1092/week @ 2025-12-15 1190/week @ 2025-12-22 780/week @ 2025-12-29 1078/week @ 2026-01-05 1071/week @ 2026-01-12 1091/week @ 2026-01-19 1583/week @ 2026-01-26 3306/week @ 2026-02-02 1316/week @ 2026-02-09 1625/week @ 2026-02-16 1699/week @ 2026-02-23 2266/week @ 2026-03-02 2543/week @ 2026-03-09 1470/week @ 2026-03-16 1549/week @ 2026-03-23

8,016 downloads per month
Used in 56 crates (20 directly)

MIT license

3KB

A crate for get local ip address, without using ifconfig or scanning network interface


local_ipaddress

Get your local ip address in Rust, using UdpSocket to get local ip address(not network interface or ifconfig), and won't panic.

API Docs: https://docs.rs/local_ipaddress

Usage

Add this to your Cargo.toml:

[dependencies]
local_ipaddress = "0.1.3"

Getting Started

use local_ipaddress;

fn main() {
    println!("{}", local_ipaddress::get().unwrap());
}

It works fine with both Windows and Linux.

License

MIT

No runtime deps