1 stable release

Uses old Rust 2015

1.0.0 Aug 22, 2018

#6 in #ipify

MIT license

4KB

Crates.io rust-stable crate-doc

ipify Client

This crate provides functionalities to retrieve your public IP. It uses hyper along with ipify. Works only on HTTP.

extern crate hyper;
extern crate ipify_api;
use hyper::rt::{self, Future};

fn main() {
    rt::run(
        ipify_api::get_ip("http://my-ipify-instance.rs")
            .map(|ip| println!("{}", ip))
            .map_err(|e| println!("{}", e)),
    );
}


lib.rs:

The ipify_api crate provides functionalities to retrieve your public IP. This crate builds on rust-stable.

It uses hyper along with ipify. To use this, add the following to your Cargo.toml.

 [dependencies]
 ipify_api = "1.0.0"

and add this to your crate root:

 extern crate ipify;

Dependencies

~4.5MB
~83K SLoC