Crates.io | northstar-rcon-client |
lib.rs | northstar-rcon-client |
version | 0.1.2 |
source | src |
created_at | 2022-08-01 11:14:17.962502 |
updated_at | 2022-08-09 06:21:58.814511 |
description | Asynchronous RCON client for the Northstar mod |
homepage | |
repository | |
max_upload_size | |
id | 636704 |
size | 24,202 |
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.
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);
}
}