Skip to content

Commit ea5c6ca

Browse files
committed
bump to v0.2.0 + update README
Features added since v0.1.0 (all live-tested against real Apps Script): - Response cache (FIFO+TTL, Cache-Control aware, 50MB cap) - Request coalescing for concurrent identical GETs - Auto-blacklist failing scripts on 429/quota (10m cooldown) - SNI-rewrite MITM tunnels for YouTube/googlevideo/doubleclick/etc. - Gzip response decoding (was breaking all requests in v0.1.0) - Firefox NSS cert install (best effort via certutil) - Periodic stats log (60s) - 'mhrv-rs test' subcommand (end-to-end relay probe) - 'mhrv-rs scan-ips' subcommand (28 Google IPs, sorted by latency) - Script IDs masked in logs Intentionally skipped with rationale (documented in README): - HTTP/2 multiplexing: coalesce+pool already parallelizes enough - Request batching: marginal gain over current async pool - Range-based parallel download: video bypasses via SNI-rewrite 25 tests pass. 2.5 MB stripped release binary.
1 parent 3f0e266 commit ea5c6ca

4 files changed

Lines changed: 29 additions & 16 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.1.0"
3+
version = "0.2.0"
44
edition = "2021"
55
description = "Rust port of MasterHttpRelayVPN -- DPI bypass via Google Apps Script relay with domain fronting"
66
license = "MIT"

README.md

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ The CA is saved at `./ca/ca.crt` — only you have the private key.
9393
mhrv-rs.exe --config config.json # Windows
9494
```
9595

96+
### Diagnostic subcommands
97+
98+
- **`mhrv-rs test`** — send one request through the relay and report success/timing. Useful when setting up or debugging. Does not need the proxy to be running.
99+
- **`mhrv-rs scan-ips`** — parallel TLS probe of known Google frontend IPs, sorted by latency. Swap the winning IP into your `google_ip` config field for best performance.
100+
96101
### Step 6: Point your browser at the proxy
97102

98103
Configure your browser to use HTTP proxy `127.0.0.1:8085`.
@@ -103,27 +108,33 @@ Configure your browser to use HTTP proxy `127.0.0.1:8085`.
103108

104109
## What's implemented vs not
105110

106-
This port focuses on the **`apps_script` mode** which is the only one that reliably works in 2025. Implemented:
111+
This port focuses on the **`apps_script` mode** which is the only one that reliably works in 2026. Implemented:
107112

108113
- [x] Local HTTP proxy (CONNECT for HTTPS, plain forwarding for HTTP)
109-
- [x] MITM with on-the-fly per-domain cert generation
110-
- [x] CA generation + auto-install on macOS/Linux/Windows
111-
- [x] Apps Script JSON relay (single-request mode), protocol-compatible with `Code.gs`
114+
- [x] MITM with on-the-fly per-domain cert generation via `rcgen`
115+
- [x] CA generation + auto-install on macOS / Linux / Windows
116+
- [x] Firefox NSS cert install (best effort via `certutil`)
117+
- [x] Apps Script JSON relay, protocol-compatible with `Code.gs`
112118
- [x] Connection pooling (45s TTL, max 20 idle)
119+
- [x] Gzip response decoding
113120
- [x] Multi-script round-robin
114-
- [x] Automatic redirect handling on the relay
121+
- [x] Auto-blacklist failing scripts on 429 / quota errors (10-minute cooldown)
122+
- [x] Response cache (50 MB, FIFO + TTL, parses `Cache-Control: max-age`, heuristics for static assets)
123+
- [x] Request coalescing: concurrent identical GETs share one upstream fetch
124+
- [x] SNI-rewrite tunnels for YouTube / googlevideo / doubleclick / etc. — bypass the relay entirely and go direct to Google's edge with SNI=`front_domain`
125+
- [x] Automatic redirect handling on the relay (`/exec``googleusercontent.com`)
115126
- [x] Header filtering (strip connection-specific + brotli)
127+
- [x] `mhrv-rs test` subcommand — one-shot end-to-end relay probe
128+
- [x] `mhrv-rs scan-ips` subcommand — parallel probe 28 Google frontend IPs, sorted by latency
129+
- [x] Periodic stats log every 60 s (relay calls, cache hit rate, bytes, active scripts)
130+
- [x] Script IDs masked in logs (prefix...suffix) so `info` logs don't leak deployment IDs
116131

117-
Deferred (PRs welcome):
132+
Intentionally NOT implemented (rationale included so future contributors don't spend cycles on them):
118133

119-
- [ ] HTTP/2 multiplexing
120-
- [ ] Request batching (`q: [...]` mode in `Code.gs`)
121-
- [ ] Request coalescing for concurrent identical GETs
122-
- [ ] Response cache
123-
- [ ] Range-based parallel download for large files
124-
- [ ] SNI-rewrite tunnels for YouTube/googlevideo (currently routes through full MITM+relay)
125-
- [ ] Firefox NSS cert install (manual: import `ca/ca.crt` in Firefox preferences)
126-
- [ ] Other modes (`domain_fronting`, `google_fronting`, `custom_domain`) — mostly broken post-Cloudflare 2024 crackdown, not a priority
134+
- [ ] **HTTP/2 multiplexing**`h2` crate state machine (stream IDs, flow control, GOAWAY) has too many subtle hang cases; coalescing + 20-connection pool already gets most of the benefit for this workload
135+
- [ ] **Request batching (`q:[...]` mode)** — our connection pool + tokio async already parallelizes well; batching adds ~200 lines of state management with unclear incremental gain over the current flow
136+
- [ ] **Range-based parallel download** — edge cases (non-Range servers, chunked mid-stream, content-encoding) are real; YouTube-style video already bypasses Apps Script via SNI-rewrite tunnel
137+
- [ ] **Other modes** (`domain_fronting`, `google_fronting`, `custom_domain`) — Cloudflare killed generic domain fronting in 2024; Cloud Run needs paid plan; skip unless specifically requested
127138

128139
## License
129140

src/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ pub struct Config {
5050
pub verify_ssl: bool,
5151
#[serde(default)]
5252
pub hosts: HashMap<String, String>,
53+
#[serde(default)]
54+
pub enable_batching: bool,
5355
}
5456

5557
fn default_google_ip() -> String {

0 commit comments

Comments
 (0)