4 releases

0.2.2 Mar 25, 2024
0.2.1 Jan 8, 2024
0.2.0 Dec 18, 2023
0.1.0 Oct 26, 2023

#777 in Network programming

Download history 27/week @ 2024-01-02 28/week @ 2024-01-09 1/week @ 2024-02-06 30/week @ 2024-02-13 49/week @ 2024-02-20 55/week @ 2024-02-27 18/week @ 2024-03-05 47/week @ 2024-03-12 74/week @ 2024-03-19 51/week @ 2024-03-26 27/week @ 2024-04-02 39/week @ 2024-04-09 136/week @ 2024-04-16

327 downloads per month

MIT license

210KB
5K SLoC

Cover logo

EPP client library for async Rust

Documentation Crates.io Build status License: MIT

Description

instant-epp is a client library written in Rust for Internet domain registration and management for domain registrars. We have implemented support for the following standards:

This library is used in production at Instant Domains.

History

instant-epp was originally created by @masalachai as epp-client in the summer of 2021. By fall, Instant Domains employees started contributing to the project. In February of 2023, after most of the contributions to epp-client had come from Instant Domains for the intervening years, we decided to fork the project, replacing its dependency on quick-xml with instant-xml in the process. Many thanks to @masalachai for starting epp-client!

Getting started

You can create a mut variable of type EppClient with the domain registry config.

use std::collections::HashMap;
use std::net::ToSocketAddrs;
use std::time::Duration;

use instant_epp::EppClient;
use instant_epp::domain::DomainCheck;
use instant_epp::common::NoExtension;

#[tokio::main]
async fn main() {
    // Create an instance of EppClient
    let timeout = Duration::from_secs(5);
    let mut client = match EppClient::connect("registry_name".to_string(), ("example.com".to_owned(), 7000), None, timeout).await {
        Ok(client) => client,
        Err(e) => panic!("Failed to create EppClient: {}",  e)
    };

    // Make a EPP Hello call to the registry
    let greeting = client.hello().await.unwrap();
    println!("{:?}", greeting);

    // Execute an EPP Command against the registry with distinct request and response objects
    let domain_check = DomainCheck { domains: &["eppdev.com", "eppdev.net"] };
    let response = client.transact(&domain_check, "transaction-id").await.unwrap();
    response
        .res_data()
        .unwrap()
        .list
        .iter()
        .for_each(|chk| println!("Domain: {}, Available: {}", chk.inner.id, chk.inner.available));
}

The output would look like this:

Domain: eppdev.com, Available: 1
Domain: eppdev.net, Available: 1

Dependencies

~4–17MB
~201K SLoC