local_ipaddress

Crates.iolocal_ipaddress
lib.rslocal_ipaddress
version0.1.3
sourcesrc
created_at2019-09-02 16:15:24.859337
updated_at2019-09-02 17:02:44.395697
descriptionGet your local IP address without panic
homepagehttps://github.com/egmkang/local_ipaddress
repositoryhttps://github.com/egmkang/local_ipaddress
max_upload_size
id161607
size3,953
egmkang wang (egmkang)

documentation

README

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

Commit count: 12

cargo fmt