2026-05-04 09:02:31 +03:30
2026-05-04 07:52:54 +03:30
2026-05-04 07:17:57 +03:30
2026-05-04 07:17:57 +03:30
2026-05-04 07:17:57 +03:30
2026-05-04 07:52:54 +03:30
2026-05-04 09:00:51 +03:30

MHR-CFW Rewritten in Go with YouTube Support Fix and Speed Improvements

GitHub

فارسی

🚀 Improvements Over Python Version

1. YouTube Support Fixed

  • 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

2. Speed Improvements

  • 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

3. Security

  • RSA 4096-bit keys — Upgraded from 2048-bit for MITM certificates

4. Reliability

  • Proper signal handling — Clean shutdown on Ctrl+C
  • Graceful error handling — Better error responses

5. Code Quality

  • Go rewrite — Static typing, better memory management
  • No external dependencies — Uses standard library where possible

How It Works

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.


Quick Start

1 - Clone and Build

git clone https://github.com/ThisIsDara/mhr-cfw-go.git
cd mhr-cfw-go

Or download the latest release from GitHub Releases

2 - Run build.bat

Double-click build.bat or run:

.\build.bat

This will build the mhr-cfw-go.exe file.

3 - Configure

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"
}

4 - Run

Double-click mhr-cfw-go.exe or run:

.\mhr-cfw-go.exe

The app opens an interactive menu. Select 1) Start proxy to begin.


5 - Install CA Certificate (for HTTPS interception)

Run the app, the select 3) Install CA certificate from the menu.

This installs the local Certificate Authority so the proxy can intercept HTTPs traffic.


🛠️ How to Setup

  1. Open mhr-cfw README File and follow the steps provided by denuitt1

Building from Source

Requirements:

go build -ldflags "-s -w" -o mhr-cfw-go.exe ./cmd/mhr-cfw

WIP...

📊 Statistics

  • Request counter — Total requests served
  • Bandwidth usage — Bytes sent/received

🖥️ Monitoring

  • Connection status

✏️ UX

  • Profile switching — Different config profiles
  • Export/Import config — Backup settings

Command Line Options

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

Disclaimer

  • 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.

Original Projects

Based on mhr-cfw, The Python implementation this project was rewritten from.

License

MIT

S
Description
Languages
Go 96.9%
Shell 2.2%
Batchfile 0.9%