MasterHttpRelayVPN
- title
- MasterHttpRelayVPN
- type
- toolbox
- summary
- Python proxy that fronts HTTPS traffic through a free Google Apps Script relay
- tags
- python, proxy, vpn, domain-fronting, censorship-circumvention, google-apps-script
- language
- Python
- license
- MIT
- created
- 2026-04-21
- updated
- 2026-04-24
See also masterhttprelayvpn-rust โ a Rust port by @therealaleph (first commit 2026-04-21, currently v1.2.11) that keeps the same architecture but ships as a static binary with an egui desktop UI and a real Android build via VpnService. Recommended for users who can't get a Python runtime working in their environment, which is a significant fraction of the target audience.
A local HTTP+SOCKS5 proxy that tunnels your traffic through a free Google Apps Script deployment, making the visible traffic look like HTTPS to www.google.com. No VPS, no paid server, no domain โ just a Google account. Aimed at users in censored networks (the repo ships an English and Persian README).
How it works
Four moving parts:
- Local proxy on the user's machine. Listens on
127.0.0.1:8085(HTTP/CONNECT) and127.0.0.1:1080(SOCKS5). The browser points at it like a normal proxy. - MITM layer for HTTPS. On first run the tool generates a CA (
ca/ca.crt), auto-installs it into the OS/Firefox trust store, and uses it to terminate browser TLS. This is what makes HTTPS requests inspectable so the outer request can be reshaped. - Fronting transport. The reshaped request opens a TLS connection to a Google-owned IP (default
216.239.38.120), sending SNIwww.google.com. Inside that connection it sends HTTP/2 toscript.google.com/macros/s/<DEPLOYMENT_ID>/execwith a JSON body describing the real request. See domain-fronting. - Google Apps Script relay.
Code.gsruns on Google's serverless JS runtime, checks a sharedAUTH_KEY, callsUrlFetchApp.fetch()against the real target, and returns the response body. No state, no account linkage beyond the deployment's owner.
โโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโ
โ Browser โโโโบโ Local proxy โโโโบโ SNI: google โโโโบโ Apps โโโโบ Target site
โ โโโโโ (MITM + HTTP)โโโโโ Host: script.. โโโโโ Script โโโโ
โโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโ
The censor's DPI/SNI filter sees a TLS handshake to www.google.com. The Host: header inside the encrypted tunnel points to a different Google property (script.google.com), which Google's own CDN happily routes.
Modes
Beyond the default Apps Script relay, the same client speaks three other fronting backends:
| Mode | Relay | Notes |
|---|---|---|
apps_script |
script.google.com/macros/s/<id>/exec |
Free. Apps Script daily quota becomes the ceiling. |
google_fronting |
Your Cloud Run service behind Google's CDN | Paid (Cloud Run), but no quota surprises. |
domain_fronting |
Cloudflare Worker | Free tier has request limits; uses domain-fronting on Cloudflare. |
custom_domain |
Your own domain on Cloudflare | Direct (no fronting), for when censorship doesn't target your domain. |
The load-balancing mechanism is just round-robin over a script_ids array โ user deploys Code.gs N times to N Google accounts, stitches the IDs together, and the client spreads load.
Configuration
config.json is small. The three values that matter:
{
"mode": "apps_script",
"script_id": "AKfy...YOUR_DEPLOYMENT_ID...",
"auth_key": "your-secret-password-here"
}
auth_key must match the AUTH_KEY constant in Code.gs โ that's the only thing preventing anyone who guesses your deployment ID from using your relay. There's no TLS pinning, no rotating tokens, no per-request signature. Given that Apps Script deployment IDs are long random strings, this is adequate obscurity-plus-secret, but not robust auth.
Tradeoffs vs VLESS/Xray-based circumvention
This tool sits in a different niche from the VLESS-based cluster (xray-tutorial, 3x-ui, mihomo, xkeen, happ-proxy):
- Setup cost. MasterHttpRelayVPN needs a Google account and two clicks in Apps Script. A VLESS setup needs a VPS ($5/mo minimum), a domain, TLS certs, and an Xray config. Massive difference.
- Performance. Every request pays the cost of HTTP-over-JSON-over-UrlFetchApp. Latency is noticeably higher than a raw VLESS tunnel, and bandwidth is bounded by Apps Script's quota.
- Blocking resistance. Google IPs are hard to block in most countries because so much infrastructure depends on them. VLESS servers on random IPs are easier to add to block lists. On the other hand, a censor that does pattern-match on TLS ClientHellos (like Iran's DPI) can fingerprint the specific front by JA3/JA4; this tool does nothing to hide that the client is Python+httpx/h2.
- Account tie. If Google detects the relay abuses Apps Script quotas/ToS, they suspend the script or the account. VLESS servers have no such single-vendor dependency.
So this is the "zero-budget, low-bandwidth, one-user" end of the circumvention space. The VLESS cluster is the "few-users, paid-VPS, higher-quality" end.
Security notes
- The local CA is a root trust anchor. If anyone else gets
ca/ca.key, they can intercept every HTTPS site the user visits. The project tells users not to shareca/, but this is standard MITM-proxy risk. auth_keyis the only gate on the Apps Script endpoint. If it leaks (e.g. committed to git), attackers can use the user's Google quota.- The project is four days old (created 2026-04-20) with 418 stars. Active, but unaudited.
Repo
https://github.com/masterking32/MasterHttpRelayVPN โ 418 stars, MIT, Python on python_testing branch. Maintainer acknowledges @abolix for the underlying approach. Persian-language Telegram support channel at @masterdnsvpn suggests the primary user base is inside Iran.
Related
- masterhttprelayvpn-rust โ Rust port with static binary, egui UI, Android VpnService support
- serverless-relay-transport โ the broader pattern this tool pioneered in the Iran-facing market
- domain-fronting โ the underlying censorship-circumvention technique
- xray-tutorial, 3x-ui, mihomo, xkeen โ the VLESS-based cluster this tool is the minimalist alternative to
- happ-proxy โ similar target audience (censored markets), different technical approach
- russia-v2ray-rules-dat โ rule files for the other major censorship-heavy audience