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

#37 in #udp-socket

Download history 1814/week @ 2024-07-31 1430/week @ 2024-08-07 1244/week @ 2024-08-14 1089/week @ 2024-08-21 1174/week @ 2024-08-28 910/week @ 2024-09-04 895/week @ 2024-09-11 844/week @ 2024-09-18 1532/week @ 2024-09-25 718/week @ 2024-10-02 801/week @ 2024-10-09 1169/week @ 2024-10-16 987/week @ 2024-10-23 932/week @ 2024-10-30 818/week @ 2024-11-06 769/week @ 2024-11-13

3,687 downloads per month
Used in 48 crates (20 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