graphical stuff

This commit is contained in:
2026-01-02 17:23:33 +01:00
parent c804695725
commit 1d72d7500a
4 changed files with 254 additions and 59 deletions

View File

@@ -0,0 +1,17 @@
use bytes::Bytes;
pub async fn get_peer_list(server_address: String) -> Result<Bytes, reqwest::Error> {
let client = reqwest::Client::new();
let uri = format!("{}/peers/", server_address);
let res = client.get(uri).send().await?;
if res.status().is_success() {
println!("Successfully retreived the addresses.");
} else {
eprintln!(
"Failed to get the peers addresses from the server. Status: {}",
res.status()
);
}
let body: Bytes = res.bytes().await?;
Ok(body)
}