#rcon #client-connect #mod #northstar #tokio

northstar-rcon-client

Asynchronous RCON client for the Northstar mod

5 releases

0.2.1 Aug 8, 2022
0.2.0 Aug 3, 2022
0.1.2 Aug 9, 2022
0.1.1 Aug 1, 2022
0.1.0 Aug 1, 2022

#1615 in Asynchronous

36 downloads per month
Used in retcon-ns

MIT license

24KB
268 lines

Northstar RCON Client

Crates.io Docs.rs MIT licensed Build status

This crate provides a high-level cross-platform implementation of an RCON client for Northstar mod, as it's implemented in the RCON PR.

The client is entirely asynchronous and requires a Tokio runtime.

Example

use northstar_rcon_client::connect;

#[tokio::main]
async fn main() {
    let client = connect("localhost:37015")
        .await
        .unwrap();
    
    let (mut read, mut write) = client.authenticate("password123")
        .await
        .unwrap();
    
    write.enable_console_logs().await.unwrap();
    write.exec_command("status").await.unwrap();
    
    loop {
        let line = read.receive_console_log().await.unwrap();
        println!("> {}", line);
    }
}

Dependencies

~4–17MB
~173K SLoC