get_local_ip

Crates.ioget_local_ip
lib.rsget_local_ip
version0.2.1
sourcesrc
created_at2019-10-19 17:41:16.787592
updated_at2019-12-28 16:09:41.830684
descriptionGet your computer ip address.
homepage
repositoryhttps://github.com/adiatma/local_ip.git
max_upload_size
id174006
size7,323
Adiatma Kamarudin (adiatma)

documentation

README

local_ip

Build Status

About

This library to get your computer ip using command ifconfig and combine with UdpSocket.

Usage

Please see the example

extern crate get_local_ip;

use get_local_ip::{local, network};

fn main() {
  // ip with port.
  println!("{:?}", network().unwrap().get()); // "192.168.43.134:49187"
  println!("{:?}", local().unwrap().get()); // "127.0.0.1:60234"

  // ip without port.
  println!("{:?}", network().unwrap().ip); // 192.168.43.134
  println!("{:?}", local().unwrap().ip); // 127.0.0.1

  // port without ip.
  println!("{:?}", network().unwrap().port); // 58096
}

Support

  • ⚠️ Coming soon to support for windows operating system.

License

MIT

Commit count: 0

cargo fmt