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 1199/week @ 2024-11-17 944/week @ 2024-11-24 895/week @ 2024-12-01 1006/week @ 2024-12-08 1223/week @ 2024-12-15 755/week @ 2024-12-22 606/week @ 2024-12-29 810/week @ 2025-01-05 1097/week @ 2025-01-12 959/week @ 2025-01-19 923/week @ 2025-01-26 1279/week @ 2025-02-02 1304/week @ 2025-02-09 872/week @ 2025-02-16 1121/week @ 2025-02-23 1957/week @ 2025-03-02

5,340 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