server handshake gui

This commit is contained in:
2026-01-02 23:21:50 +01:00
parent 1914c68c9f
commit 74f30f2c7f
5 changed files with 91 additions and 55 deletions

View File

@@ -1,4 +1,5 @@
use bytes::Bytes;
use rand::Rng;
pub async fn get_peer_list(server_address: String) -> Result<Bytes, reqwest::Error> {
let client = reqwest::Client::new();
@@ -15,3 +16,7 @@ pub async fn get_peer_list(server_address: String) -> Result<Bytes, reqwest::Err
let body: Bytes = res.bytes().await?;
Ok(body)
}
pub fn generate_id() -> i32 {
rand::rng().random_range(0..i32::MAX)
}