#local #ifconfig #panic #networking #ip-address #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

#963 in Network programming

Download history 1111/week @ 2023-10-29 1411/week @ 2023-11-05 1464/week @ 2023-11-12 1312/week @ 2023-11-19 1182/week @ 2023-11-26 1173/week @ 2023-12-03 1191/week @ 2023-12-10 1053/week @ 2023-12-17 561/week @ 2023-12-24 706/week @ 2023-12-31 1024/week @ 2024-01-07 1052/week @ 2024-01-14 1071/week @ 2024-01-21 1107/week @ 2024-01-28 1176/week @ 2024-02-04 1128/week @ 2024-02-11

4,546 downloads per month
Used in 40 crates (19 directly)

MIT license

3KB

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


lib.rs:

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

No runtime deps