#ipify #networking #org #ip #interface #resolution #client

ipify-client

A client interface to the ipify.org IP resolution service

1 unstable release

Uses old Rust 2015

0.1.0 Aug 4, 2018

#5 in #ipify

GPL-3.0-or-later

15KB
132 lines

ipify-client

A Rust client interface to the ipify.org IP resolution service.

Usage

[dependencies]
ipify-client = "0.1.0"
extern crate futures;
extern crate hyper;
extern crate ipify_client;

use futures::Future;
use hyper::rt;

fn main() {
        let future = ipify_client::get_ip()
            .map(|ip| {
                println!("This machine's IP address: {}", ip);
            })
            .map_err(|e| {
                eprintln!("failed to successfully resolve future: {:?}", e)
            });
    rt::run(future);
}

Prints, e.g.:

This machine's IP address: 1.2.3.4

lib.rs:

Rusty interface to ipify.org

Dependencies

~6.5MB
~119K SLoC