Library / SDK
denuitt1/mhr-cfw avatar
denuitt1/mhr-cfw

MHR-CFW: a domain-fronted HTTP relay that exits through Cloudflare Workers

A Domain-Fronting Relay that routes traffic though GAS (Google Apps Script) and forwards it to Cloudflare Workers. Designed to bypass DPI.

4,469 stars416 forksPythonMIT

At a glance

What is it?
MHR-CFW chains a local MITM proxy, Google Apps Script and a Cloudflare Worker so network filters see traffic to www.google.com. It is a Python project for people who need a proxy on a hostile network, and it asks for real deployment work before it does anything.
Who is it for?
Adopt MHR-CFW if you can run a local Python process, deploy a Google Apps Script web app and a Cloudflare Worker, and accept that every connection is TLS-intercepted with your own CA certificate. Do not adopt it if you cannot install a CA on every device, or if a plain SSH tunnel or a commercial proxy already gets you out.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Activity is slowing. The repository last received commits 6 months ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • denuitt1/mhr-cfw4,469 ★ · +56
Star history
Repository2026-09-232026-11-22
denuitt1/mhr-cfw4.4k4.5k

56 Stars in the last 60 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

What MHR-CFW is for, and who ends up running it

The project describes itself as an MITM domain-fronted HTTP relay with a Cloudflare Worker exit. The problem it addresses is a network that inspects the TLS handshake and decides which destinations are allowed. Instead of connecting to the site you want, the client connects to something that looks like Google infrastructure, and the real destination travels inside the relay request. The README states the intent plainly: the filter sees normal-looking Google traffic while the actual destination stays hidden.

The audience is narrow. You need a machine that can run Python 3.10 or newer, an account that can create a Cloudflare Worker, and a Google account that can publish an Apps Script web app. The README also gives instructions for sharing the proxy with a phone on the same Wi-Fi, and for reaching it from inside a virtual machine, which suggests the author expects a laptop or a small always-on host rather than a server rack. Requirements list cryptography, h2, brotli and zstandard as optional extras.

The relay path: local proxy, Apps Script hop, Worker exit

The README draws two topologies. The first is Client, then Local Relay, then Google or CDN front, then the GAS relay, then a Cloudflare Worker, then the exit. The second inserts a self-hosted upstream forwarder between the Worker and the exit, which the README presents as the way to get a stable exit IP.

The local relay is a proxy the browser points at. It performs SSL inspection, which is why the README tells you to install the included ca.crt and why the VM instructions tell you to install it with update-ca-certificates. That is the part people underestimate: this is not a tunnel that leaves TLS intact end to end. The relay terminates TLS locally so it can read the request, then re-encrypts on the way out. The GAS deployment is configured with an AUTH_KEY and a WORKER_URL constant, and the Worker is configured with its own WORKER_URL line. The password you set in Code.gs has to match the one the setup wizard writes into config.json, otherwise the relay cannot authenticate to the Apps Script endpoint.

Optionally, h2 is used for HTTP/2 multiplexing to speed up the Apps Script relay, according to the requirements comments.

Installing MHR-CFW and making the first request

Clone the repository and install the Python dependencies. The README gives a mirror command for networks that cannot reach PyPI directly, which fits the project's premise.

bash
git clone https://github.com/denuitt1/mhr-cfw.git
cd mhr-cfw
pip install -r requirements.txt

Next, deploy the Worker. In the Cloudflare dashboard, go to Compute, then Workers & Pages, create an application from the Hello World template, deploy it, edit the code, and replace the default contents with the project's deploy/cloudflare-worker/worker.js. The README calls out one line that must be changed to your own worker hostname.

javascript
const WORKER_URL = "myworker.workers.dev";

Then deploy the Google side. Create a new Apps Script project, paste deploy/gas/Code.gs, and set both constants. The README warns to pick a password only you know and to use the same value later in the config file.

javascript
const AUTH_KEY = "your-secret-password-here";
const WORKER_URL = "https://myworker.workers.dev";

Deploy it as a web app with Execute as: Me and Who has access: Anyone, then copy the Deployment ID. Start the relay with run.bat on Windows or run.sh on Linux. The first run opens an interactive setup wizard, which the repository implements in setup.py, and prompts for the AUTH_KEY and the Apps Script Deployment ID. The README says you should see a message that the HTTP proxy is running on 127.0.0.1:8085.

Point a browser at the proxy, or run the container, which maps both ports.

yaml
ports:
  - "8085:8085" # http port
  - "1080:1080" # socks5 port

Finally, open ipleak.net. The README states you should see your IP address set as Cloudflare's. If you see your ISP's address, the relay is not in the path.

TLS interception is the cost of entry

Every device that uses this proxy needs the bundled ca.crt installed as a trusted root, and on iOS you also have to enable it under Certificate Trust Settings. That is a real security decision, not a setup annoyance. A root certificate that the relay holds can sign anything for any hostname, so the machine running the relay becomes a single point of compromise for all traffic from every device you enroll. On Android, the README routes you through Settings, Security, Install a certificate, CA certificate. On Linux it is a copy into /usr/local/share/ca-certificates and update-ca-certificates.

Applications that pin certificates will break. Treat any app that refuses to connect as an expected outcome rather than a bug. The same goes for clients that ignore the system trust store and ship their own CA bundle.

If you rotate the AUTH_KEY in Code.gs, you must update config.json to match.

CAPTCHAs and the optional upstream forwarder

The README's own description of the optional upstream forwarder is the most honest part of the document. It explains that CAPTCHAs such as Cloudflare Turnstile, reCAPTCHA and hCaptcha bind their tokens to the IP that solved the challenge. Because Cloudflare Workers exit through different edge IPs per request, verification on the target site fails even when you solve the challenge.

Inserting a self-hosted upstream forwarder changes the exit to an address you control, which is the point of the second topology. That is a meaningful difference, and it is also extra infrastructure: you now maintain a forwarder host in addition to the Worker and the Apps Script project.

The same trade-off shows up in the verification step. ipleak.net reporting a Cloudflare address confirms the relay is working, and it also confirms your traffic exits through Cloudflare's edge IPs. For low-friction browsing that is fine. For anything that gates access on reputation, it is the failure mode.

Where MHR-CFW is the wrong tool

If you have a working SSH tunnel or a WireGuard endpoint outside the filtered network, use it. MHR-CFW adds two third-party hops, a CA you must distribute, and a dependency on Google Apps Script quotas, all to reach a destination that a single encrypted tunnel would carry without inspection. The domain-fronting trick earns its complexity only when direct outbound connections to arbitrary hosts are blocked and only Google-facing traffic is allowed.

It is also the wrong tool for anything that needs a stable, attributable exit address. The default path exits at a Cloudflare Worker, and the README's own CAPTCHA section is the evidence that this address changes per request and breaks CAPTCHA verification. If your work depends on maintaining a session with a service that scores IP reputation, the optional forwarder is not optional.

Finally, it is wrong for anyone who cannot install a root certificate on the client devices. Without ca.crt, TLS inspection produces certificate errors, and the relay cannot read the requests it is supposed to forward.

Alternatives and how they differ

v2rayN is the client the README itself recommends for using the relay, and it is worth separating the two roles. v2rayN is a proxy client: it presents SOCKS5 or HTTP locally and speaks whatever outbound protocol you configure. MHR-CFW is the outbound path, and v2rayN can point at it. The README's instruction to configure a socks5 proxy in v2rayN is exactly that arrangement, which means v2rayN is not a replacement for the relay, it is a front end for it.

A plain SSH dynamic forward is the real alternative. One command gives you a local SOCKS proxy, TLS stays end to end, and no certificate is installed on any device. The difference in approach is total: SSH assumes you can reach a host outside the filter on port 22, while MHR-CFW assumes you cannot reach anything except Google-facing endpoints. If port 22 is open to you, the SSH tunnel wins on every axis this project is weak on: no interception, no CA, no third-party quota.

FoxyProxy, which the README lists for Chrome and Firefox, sits in the same category as v2rayN. It routes browser traffic to a proxy you already have. It does not provide the relay.

Maintenance, licence and upgrade cost

The repository is not archived and the most recent push was on 2026-05-10, the same day as the v2.0.2 release. Releases v2.0.0, v2.0.1 and v2.0.2 all landed within about two weeks in April and May 2026. A TODO.md exists at the repository root.

The licence is MIT, which permits commercial use, modification and redistribution provided the copyright notice and permission notice are retained. That covers the Python relay and the deploy files. It does not cover the services you depend on: Cloudflare's Workers terms and Google's Apps Script terms govern those deployments. If you deploy this inside an organisation, those two sets of terms are the ones to read, not the MIT text.

Upgrade cost is concentrated in three places. The Worker code and the Apps Script code are separate deployments, so a version bump can require pasting new code into two dashboards. The AUTH_KEY and WORKER_URL constants live in the Apps Script editor and must stay in sync with config.json. And every device that uses the relay has ca.crt installed, so if that certificate changes, every enrolled device needs the new one installed.

Editorial conclusion

Adopt MHR-CFW if you can run a local Python process, deploy a Google Apps Script web app and a Cloudflare Worker, and accept that every connection is TLS-intercepted with your own CA certificate. Do not adopt it if you cannot install a CA on every device, or if a plain SSH tunnel or a commercial proxy already gets you out. Before trusting it, verify the AUTH_KEY in Code.gs matches config.json, confirm the WORKER_URL constant in both Code.gs and worker.js points at your own worker, and check that ipleak.net reports a Cloudflare address rather than your ISP's.

Frequently asked questions

What is MHR-CFW?

It is an MIT-licensed Python project that runs a local MITM HTTP relay, forwards traffic through a Google Apps Script deployment, and exits through a Cloudflare Worker. The README describes it as a domain-fronting relay designed to bypass DPI, showing www.google.com to the network filter.

Which port does the MHR-CFW relay listen on?

The README says the HTTP proxy runs on 127.0.0.1:8085, and the docker-compose.yml file maps 8085 for HTTP and 1080 for SOCKS5. The VM instructions use the same 8085 port against the hypervisor gateway address.

Can I use MHR-CFW on my phone?

Yes, if the phone is on the same Wi-Fi network. The README describes finding your host IP, forwarding port 8085 on Windows with netsh, setting the proxy manually in the phone's Wi-Fi settings, and installing ca.crt as a CA certificate.

Why do I get certificate errors when using MHR-CFW?

The relay performs SSL inspection, so clients see certificates signed by the project's own CA rather than the site's. The README instructs you to install the included ca.crt, for example with sudo cp ca.crt /usr/local/share/ca-certificates/ && sudo update-ca-certificates on Linux.

Does MHR-CFW work inside a virtual machine?

The README covers this. A VM cannot reach the host's localhost by default, so in VirtualBox NAT mode you point the proxy at 10.0.2.2:8085 instead of 127.0.0.1, and install ca.crt inside the guest to avoid certificate errors.

Official sources

  1. denuitt1/mhr-cfw on GitHub
  2. Issues
  3. License: MIT
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/denuitt1-mhr-cfw.svg)](https://hysenlabs.com/projects/denuitt1-mhr-cfw)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/denuitt1-mhr-cfw.svg)](https://hysenlabs.com/projects/denuitt1-mhr-cfw)

Was this useful?