#ip-address #panic #local-ipaddress

bin+lib local_ipaddress

Get your local IP address without panic

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

#21 in #ip-address

Download history 1235/week @ 2024-12-14 761/week @ 2024-12-21 628/week @ 2024-12-28 759/week @ 2025-01-04 1091/week @ 2025-01-11 941/week @ 2025-01-18 967/week @ 2025-01-25 1245/week @ 2025-02-01 1325/week @ 2025-02-08 879/week @ 2025-02-15 1113/week @ 2025-02-22 1885/week @ 2025-03-01 1769/week @ 2025-03-08 1352/week @ 2025-03-15 1184/week @ 2025-03-22 1341/week @ 2025-03-29

6,058 downloads per month
Used in 49 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