Skip to content

Commit 70d60f1

Browse files
committed
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.
1 parent 4d1600a commit 70d60f1

4 files changed

Lines changed: 7 additions & 11 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mhrv-rs"
3-
version = "0.4.1"
3+
version = "0.4.2"
44
edition = "2021"
55
description = "Rust port of MasterHttpRelayVPN -- DPI bypass via Google Apps Script relay with domain fronting"
66
license = "MIT"

src/bin/ui.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -563,15 +563,7 @@ fn background_thread(shared: Arc<Shared>, rx: Receiver<Cmd>) {
563563
return;
564564
}
565565
};
566-
match DomainFronter::new(&cfg) {
567-
Ok(f) => {
568-
let arc = Arc::new(f);
569-
*fronter_slot2.lock().await = Some(arc);
570-
}
571-
Err(e) => {
572-
push_log(&shared2, &format!("[ui] fronter build failed: {}", e));
573-
}
574-
}
566+
*fronter_slot2.lock().await = Some(server.fronter());
575567
{
576568
let mut s = shared2.state.lock().unwrap();
577569
s.running = true;

src/proxy_server.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ impl ProxyServer {
114114
})
115115
}
116116

117+
pub fn fronter(&self) -> Arc<DomainFronter> {
118+
self.fronter.clone()
119+
}
120+
117121
pub async fn run(self) -> Result<(), ProxyError> {
118122
let http_addr = format!("{}:{}", self.host, self.port);
119123
let socks_addr = format!("{}:{}", self.host, self.socks5_port);

0 commit comments

Comments
 (0)