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 1093/week @ 2024-03-24 1398/week @ 2024-03-31 1164/week @ 2024-04-07 2109/week @ 2024-04-14 1346/week @ 2024-04-21 936/week @ 2024-04-28 965/week @ 2024-05-05 1029/week @ 2024-05-12 1302/week @ 2024-05-19 1468/week @ 2024-05-26 1831/week @ 2024-06-02 1363/week @ 2024-06-09 1674/week @ 2024-06-16 1499/week @ 2024-06-23 1121/week @ 2024-06-30 1411/week @ 2024-07-07

5,797 downloads per month
Used in 45 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