Skip to content

Get local ip address in rust, equivalent to `hostname -I` in linux

License

Notifications You must be signed in to change notification settings

ivanceras/machine-ip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

machine-ip

Get your local ip address in Rust, using hostname -I under the hood, may not work in older versions of windows

machine-ip = "0.1"

then

extern crate machine_ip;

let ip = machine_ip::get().unwrap();
println!("local ip address: {:?}", ip.to_string());

Warning

This crate just wraps the hostname command, so it only works on unix based OS, and this doesn't work on windows.

License

MIT

About

Get local ip address in rust, equivalent to `hostname -I` in linux

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages