Back to feed

ThisIsDara/mhr-cfw-go

ThisIsDara/mhr-cfw-go
206
+52/day
20
GoInfrastructure

A local proxy that runs on your machine and forwards traffic through Google.

From the README

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

فارسی

🚀 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

📦 Requirements:

💡 Tip: If you have trouble downloading Go dependencies, use the Runflare Iranian mirror:

GOPROXY= go mod download

1 - Clone and Build

git clone 
cd mhr-cfw-go

Or download the latest release from 📥 GitHub Releases

2 - Build

Windows: Double-click build.bat or run:

.\build.bat

Linux/Mac: Make the script executable and run:

chmod +x build.sh
./build.sh

This will build the executable (mhr-cfw-go.exe on Windows, mhr-cfw-go on Linux/Mac).

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

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

.\mhr-cfw-go.exe

Linux/Mac: Run:

./mhr-cfw-go

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

5 - Install CA Certificate (for HTTPS interception)

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.

🐧 Linux / 🍎 macOS / 📱 Termux Guide

Linux/macOS

# Clone
git clone 
cd mhr-cfw-go

# Build
chmod +x build.sh
./build.sh

# Run
./mhr-cfw-go

Or manually:

GOOS=linux go build -ldflags "-s -w" -o mhr-cfw-go ./cmd/mhr-cfw
./mhr-cfw-go

Termux (Android)

# Install Go and Git
pkg update -y
pkg install -y golang git

# Clone
git clone 
cd mhr-cfw-go

# Build
chmod +x