feat: add network overview

This commit is contained in:
zhom
2025-11-30 15:04:48 +04:00
parent 01b3109dc1
commit cdba9aac33
20 changed files with 2416 additions and 48 deletions
+9 -1
View File
@@ -11,6 +11,14 @@ lazy_static::lazy_static! {
pub async fn start_proxy_process(
upstream_url: Option<String>,
port: Option<u16>,
) -> Result<ProxyConfig, Box<dyn std::error::Error>> {
start_proxy_process_with_profile(upstream_url, port, None).await
}
pub async fn start_proxy_process_with_profile(
upstream_url: Option<String>,
port: Option<u16>,
profile_id: Option<String>,
) -> Result<ProxyConfig, Box<dyn std::error::Error>> {
let id = generate_proxy_id();
let upstream = upstream_url.unwrap_or_else(|| "DIRECT".to_string());
@@ -22,7 +30,7 @@ pub async fn start_proxy_process(
listener.local_addr().unwrap().port()
});
let config = ProxyConfig::new(id.clone(), upstream, Some(local_port));
let config = ProxyConfig::new(id.clone(), upstream, Some(local_port)).with_profile_id(profile_id);
save_proxy_config(&config)?;
// Spawn proxy worker process in the background using std::process::Command