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

#27 in #udp-socket

Download history 989/week @ 2024-01-11 1122/week @ 2024-01-18 1032/week @ 2024-01-25 960/week @ 2024-02-01 1126/week @ 2024-02-08 1411/week @ 2024-02-15 1336/week @ 2024-02-22 1832/week @ 2024-02-29 1241/week @ 2024-03-07 1207/week @ 2024-03-14 1183/week @ 2024-03-21 1295/week @ 2024-03-28 1147/week @ 2024-04-04 1771/week @ 2024-04-11 1813/week @ 2024-04-18 984/week @ 2024-04-25

5,963 downloads per month
Used in 41 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