v0.4.2: UI reads stats from the running proxy's fronter

The UI was creating its own DomainFronter instance and polling stats
from it, while traffic actually went through the ProxyServer's own
internal fronter. Result: stats grid stuck at zero even with traffic
flowing.

Fix: expose ProxyServer::fronter() and have the UI pick up that handle
once the server is built, instead of constructing a parallel fronter.
This commit is contained in:
therealaleph
2026-04-21 22:35:59 +03:00
parent 4d1600a349
commit 70d60f1951
4 changed files with 7 additions and 11 deletions
Generated
+1 -1
View File
@@ -1360,7 +1360,7 @@ dependencies = [
[[package]] [[package]]
name = "mhrv-rs" name = "mhrv-rs"
version = "0.4.1" version = "0.4.2"
dependencies = [ dependencies = [
"base64 0.22.1", "base64 0.22.1",
"bytes", "bytes",
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "mhrv-rs" name = "mhrv-rs"
version = "0.4.1" version = "0.4.2"
edition = "2021" edition = "2021"
description = "Rust port of MasterHttpRelayVPN -- DPI bypass via Google Apps Script relay with domain fronting" description = "Rust port of MasterHttpRelayVPN -- DPI bypass via Google Apps Script relay with domain fronting"
license = "MIT" license = "MIT"
+1 -9
View File
@@ -563,15 +563,7 @@ fn background_thread(shared: Arc<Shared>, rx: Receiver<Cmd>) {
return; return;
} }
}; };
match DomainFronter::new(&cfg) { *fronter_slot2.lock().await = Some(server.fronter());
Ok(f) => {
let arc = Arc::new(f);
*fronter_slot2.lock().await = Some(arc);
}
Err(e) => {
push_log(&shared2, &format!("[ui] fronter build failed: {}", e));
}
}
{ {
let mut s = shared2.state.lock().unwrap(); let mut s = shared2.state.lock().unwrap();
s.running = true; s.running = true;
+4
View File
@@ -114,6 +114,10 @@ impl ProxyServer {
}) })
} }
pub fn fronter(&self) -> Arc<DomainFronter> {
self.fronter.clone()
}
pub async fn run(self) -> Result<(), ProxyError> { pub async fn run(self) -> Result<(), ProxyError> {
let http_addr = format!("{}:{}", self.host, self.port); let http_addr = format!("{}:{}", self.host, self.port);
let socks_addr = format!("{}:{}", self.host, self.socks5_port); let socks_addr = format!("{}:{}", self.host, self.socks5_port);