19 stable releases

1.2.3 Jul 29, 2020
1.1.11 Jun 27, 2020
1.1.10 Feb 27, 2020
1.1.9 Sep 17, 2019
1.1.4 Nov 14, 2018

#12 in WebSocket

Download history 28/week @ 2020-06-03 2/week @ 2020-06-10 18/week @ 2020-06-17 15/week @ 2020-06-24 32/week @ 2020-07-01 4/week @ 2020-07-08 39/week @ 2020-07-15 41/week @ 2020-07-22 40/week @ 2020-07-29 1/week @ 2020-08-05 59/week @ 2020-08-12 20/week @ 2020-08-19 21/week @ 2020-08-26 38/week @ 2020-09-02 20/week @ 2020-09-09 4/week @ 2020-09-16

111 downloads per month

MIT license

19KB
370 lines

WHOIS Rust

Build Status

This is a WHOIS client library for Rust, inspired by https://github.com/hjr265/node-whois

Usage

You can make a servers.json file or copy one from https://github.com/hjr265/node-whois

This is a simple example of servers.json.

{
    "org": "whois.pir.org",
    "": "whois.ripe.net",
    "_": {
        "ip": {
            "host": "whois.arin.net",
            "query": "n + $addr\r\n"
        }
    }
}

Then, use the from_path (or from_string if your JSON data is in-memory) associated function to create a WhoIs instance.

extern crate whois_rust;

use whois_rust::WhoIs;

let whois = WhoIs::from_path("/path/to/servers.json").unwrap();

Use the lookup method and input a WhoIsLookupOptions instance to lookup a domain or an IP.

extern crate whois_rust;

use whois_rust::{WhoIs, WhoIsLookupOptions};

let whois = WhoIs::from_path("/path/to/servers.json").unwrap();

let result: String = whois.lookup(WhoIsLookupOptions::from_string("magiclen.org").unwrap()).unwrap();

Crates.io

https://crates.io/crates/whois-rust

Documentation

https://docs.rs/whois-rust

License

MIT

Dependencies

~3.5–5MB
~132K SLoC