refactor: add robust proxy lifecycle management"

This commit is contained in:
zhom
2026-06-23 22:10:16 +04:00
parent 4ac4c6e8a9
commit 4598b22af1
5 changed files with 280 additions and 29 deletions
+8
View File
@@ -22,6 +22,13 @@ pub struct ProxyConfig {
/// `upstream_url`, which is the real upstream proxy/VPN this worker dials.
#[serde(default)]
pub local_protocol: Option<String>,
/// PID of the browser process this worker serves, recorded by the GUI after
/// launch. The detached worker watches this and self-terminates when the
/// browser dies, so it dies with its browser even if the GUI has exited or
/// restarted. `None` until launch completes (the worker keeps running while
/// it is `None`).
#[serde(default)]
pub browser_pid: Option<u32>,
}
impl ProxyConfig {
@@ -37,6 +44,7 @@ impl ProxyConfig {
bypass_rules: Vec::new(),
blocklist_file: None,
local_protocol: None,
browser_pid: None,
}
}