diff --git a/tui/src/http.rs b/tui/src/http.rs index 6e1f639..f99925f 100644 --- a/tui/src/http.rs +++ b/tui/src/http.rs @@ -2,8 +2,10 @@ use cursive::Cursive; use reqwest; use crate::types::Channel; -pub async fn fetch_channels(domain: &str) -> Option>{ - if let Ok(resp) = reqwest::get(&format!("{}/channels/list", domain)).await { +pub async fn fetch_channels(domain: &str, port: u16) -> Option>{ + let url = format!("http://{}:{}/channels/list", domain, port); + + if let Ok(resp) = reqwest::get(&url).await { let bytes = resp.bytes().await.unwrap(); let res: Result, serde_json::Error> = serde_json::from_slice(&bytes); return match res {