MHR-CFW Rewritten in Go with YouTube Support Fix and Speed Improvements
- Proper CORS handling β Added preflight OPTIONS handling and CORS header injection for cross-origin requests
- Content-Encoding fix β Better decoding for brotli/gzip responses
- Range request support β Video streaming needs proper Range header handling
- HTTP/2 transport β Uses HTTP/2 instead of HTTP/1.1 (faster multiplexing)
- Connection pooling β Reuses TLS connections instead of creating new ones
- Request coalescing β Multiple GET requests for same URL share one relay call
- Response caching β LRU cache with proper TTL for static assets
- RSA 4096-bit keys β Upgraded from 2048-bit for MITM certificates
- Proper signal handling β Clean shutdown on Ctrl+C
- Graceful error handling β Better error responses
- Go rewrite β Static typing, better memory management
- No external dependencies β Uses standard library where possible
The program runs on your PC and sends your requests through Google's infrastructure. Network filters see ordinary Google traffic and allow it through. Meanwhile, Google's free Apps Script fetches the actual website you wanted.
π‘ Tip: If you have trouble downloading Go dependencies, use the Runflare Iranian mirror:
GOPROXY=https://mirror-go.runflare.com go mod downloadgit clone https://github.com/ThisIsDara/mhr-cfw-go.git
cd mhr-cfw-goOr download the latest release from π₯ GitHub Releases
Windows: Double-click build.bat or run:
.\build.batLinux/Mac: Make the script executable and run:
chmod +x build.sh
./build.shThis will build the executable (mhr-cfw-go.exe on Windows, mhr-cfw-go on Linux/Mac).
Edit config.json with your settings or ideally run Setup Wizard in the TUI:
{
"auth_key": "your-secret-password-here",
"script_id": "YOUR_DEPLOYMENT_ID"
}Windows: Double-click mhr-cfw-go.exe or run:
.\mhr-cfw-go.exeLinux/Mac: Run:
./mhr-cfw-goThe app opens an interactive menu. Select 1) Start proxy to begin.
Run the app, then select 3) Install CA certificate from the menu.
This installs the local Certificate Authority so the proxy can intercept HTTPS traffic.
# Clone
git clone https://github.com/ThisIsDara/mhr-cfw-go.git
cd mhr-cfw-go
# Build
chmod +x build.sh
./build.sh
# Run
./mhr-cfw-goOr manually:
GOOS=linux go build -ldflags "-s -w" -o mhr-cfw-go ./cmd/mhr-cfw
./mhr-cfw-go# Install Go and Git
pkg update -y
pkg install -y golang git
# Clone
git clone https://github.com/ThisIsDara/mhr-cfw-go.git
cd mhr-cfw-go
# Build
chmod +x build.sh
./build.sh
# Run
./mhr-cfw-goPress Ctrl+C to stop the proxy.
- Open mhr-cfw README File provided by denuitt1 and follow the steps 1 to 3 until you have the Deployment ID
Requirements:
go build -ldflags "-s -w" -o mhr-cfw-go.exe ./cmd/mhr-cfw- Request counter β Total requests served
- Bandwidth usage β Bytes sent/received
- Connection status
- Profile switching β Different config profiles
- Export/Import config β Backup settings
| Option | Description |
|---|---|
--no-menu |
Run without TUI menu |
--port |
Override proxy port |
--host |
Override listen host |
--socks5-port |
Override SOCKS5 port |
--disable-socks5 |
Disable SOCKS5 proxy |
--log-level |
Set log level (DEBUG, INFO, WARN, ERROR) |
--install-cert |
Install CA certificate |
--uninstall-cert |
Remove CA certificate |
--scan |
Scan Google IPs |
--setup |
Run setup wizard |
--version |
Show version |
- Google services compliance: If you use Google Apps Script or other Google services with this project, you are responsible for complying with Google's Terms of Service, acceptable use rules, quotas, and platform policies. Misuse may lead to suspension or termination of your Google account or deployments.
Based on mhr-cfw, The Python implementation this project was rewritten from.
MIT