localip 0.2.0

A simple library to find the local IP address of the machine.
Documentation
  • Coverage
  • 50%
    1 out of 2 items documented0 out of 2 items with examples
  • Size
  • Source code size: 3.61 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 105.2 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 6s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • tarunregmi/localip
    2 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • tarunregmi

localip

A lightweight Rust library for discovering the local IP address of your machine. It uses a simple, connectionless UDP-based approach to reliably determine the local IP address without requiring internet connectivity or third-party dependencies.

Installation

Add this to your Cargo.toml:

[dependencies]
localip = "0.1.0"

Example:

use localip::get_local_ip;

fn main() {
    match get_local_ip() {
        Ok(ip) => println!("Local IP address: {}", ip),
        Err(e) => eprintln!("Error: {}", e),
    }
}