diff --git a/.gitignore b/.gitignore index 6dd3af6..f885c1e 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,4 @@ build_hook.go *.md !LICENSE !README_FA.md -!README.md -!Linux/ -!Linux/*.sh \ No newline at end of file +!README.md \ No newline at end of file diff --git a/README.md b/README.md index 0d88014..e72d023 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ **[فارسی](README_FA.md)** +image ## 🚀 Improvements Over Python Version @@ -42,6 +43,14 @@ The program runs on your PC and sends your requests through Google's infrastruct ## Quick Start + ## 📦 Requirements: + - [Go 1.22+](https://go.dev/dl/) + + **💡 Tip:** If you have trouble downloading Go dependencies, use the Runflare Iranian mirror: +```bash +GOPROXY=https://mirror-go.runflare.com go mod download +``` + ### 1 - Clone and Build ```bash @@ -49,7 +58,7 @@ git clone https://github.com/ThisIsDara/mhr-cfw-go.git cd mhr-cfw-go ``` -Or download the latest release from [GitHub Releases](https://github.com/ThisIsDara/mhr-cfw-go/releases) +Or download the latest release from [ 📥 GitHub Releases](https://github.com/ThisIsDara/mhr-cfw-go/releases) ### 2 - Run build.bat @@ -94,8 +103,8 @@ This installs the local Certificate Authority so the proxy can intercept HTTPs t # 🛠️ How to Setup -1. Open [mhr-cfw README File](https://github.com/denuitt1/mhr-cfw/blob/main/README.md#how-to-use) and follow the steps provided by [denuitt1](https://github.com/denuitt1) - +1. Open [mhr-cfw README File](https://github.com/denuitt1/mhr-cfw/blob/main/README.md#how-to-use) provided by [denuitt1](https://github.com/denuitt1) + and follow the steps 1 to 3 until you have the Deployment ID --- ## Building from Source diff --git a/README_FA.md b/README_FA.md index 1fcddfd..0b931b0 100644 --- a/README_FA.md +++ b/README_FA.md @@ -1 +1,160 @@ -Soon... \ No newline at end of file +# [MHR-CFW](https://github.com/denuitt1/mhr-cfw) Rewritten in Go with YouTube Support Fix and Speed Improvements + +[![GitHub](https://img.shields.io/badge/GitHub-ThisIsDara-blue?logo=github)](https://github.com/ThisIsDara/mhr-cfw-go) + +**[English](README.md)** + +## 🚀 بهبودها نسبت به نسخه Python + +## **✅ 1. رفع مشکل پشتیبانی YouTube** + +* مدیریت درست CORS — اضافه شدن هندل کردن preflight OPTIONS و تزریق هدرهای CORS برای درخواست‌های cross-origin +* رفع مشکل Content-Encoding — دیکود بهتر برای پاسخ‌های brotli/gzip +* پشتیبانی از Range request — استریم ویدیو نیاز به مدیریت درست هدر Range دارد + +## **✅ 2. بهبود سرعت** + +* استفاده از HTTP/2 به جای HTTP/1.1 (multiplexing سریع‌تر) +* Connection pooling — استفاده مجدد از اتصال‌های TLS به جای ساختن اتصال جدید +* Request coalescing — چند درخواست GET برای یک URL مشترک، یک تماس relay را به اشتراک می‌گذارند +* Response caching — کش LRU با TTL مناسب برای assetهای استاتیک + +## **✅ 3. امنیت** + +* ارتقا از 2048 بیت به کلید های RSA با طول 4096 بیت برای گواهی‌های MITM + +## **✅ 4. کیفیت کد** + +* بازنویسی با Go — تایپ استاتیک، مدیریت حافظه بهتر +* بدون وابستگی خارجی — استفاده از کتابخانه استاندارد در صورت امکان + +--- + +## نحوه کار + +این برنامه روی سیستم شما اجرا می‌شود و درخواست‌های شما را از طریق زیرساخت Google ارسال می‌کند. فیلترهای شبکه این ترافیک را به عنوان ترافیک عادی Google می‌بینند و اجازه عبور می‌دهند. در همین حین، Apps Script رایگان Google سایت واقعی مورد نظر شما را دریافت می‌کند. + +--- + +## شروع سریع + +### 1 - کلون و بیلد + +```bash +git clone https://github.com/ThisIsDara/mhr-cfw-go.git +cd mhr-cfw-go +``` + +یا آخرین نسخه را از [GitHub Releases](https://github.com/ThisIsDara/mhr-cfw-go/releases) دانلود کنید + +**💡 نکته:** اگر در نصب وابستگی‌های Go مشکل دارید، از میرور ایرانی رانفلر استفاده کنید: +```bash +GOPROXY=https://mirror-go.runflare.com go mod download +``` + +### 2 - اجرای build.bat + +روی `build.bat` دوبار کلیک کنید یا اجرا کنید: + +```powershell +.\build.bat +``` + +این کار فایل `mhr-cfw-go.exe` را می‌سازد + +### 3 - تنظیمات + +فایل `config.json` را با تنظیمات خود ویرایش کنید یا ترجیحاً Setup Wizard را در TUI اجرا کنید: + +```json +{ + "auth_key": "your-secret-password-here", + "script_id": "YOUR_DEPLOYMENT_ID" +} +``` + +### 4 - اجرا + +روی `mhr-cfw-go.exe` دوبار کلیک کنید یا اجرا کنید: + +```powershell +.\mhr-cfw-go.exe +``` + +برنامه یک منو باز می‌کند. گزینه `1) Start proxy` را انتخاب کنید تا پراکسی شروع شود. + +--- + +### 5 - نصب CA Certificate (برای HTTPS) + +برنامه را اجرا کنید، سپس از منو گزینه `3) Install CA certificate` را انتخاب کنید. + +این کار Certificate Authority محلی را نصب می‌کند تا پراکسی بتواند ترافیک HTTPs را رهگیری کند. + +--- + +# 🛠️ نحوه راه‌اندازی + +1. فایل [mhr-cfw README](https://github.com/denuitt1/mhr-cfw/blob/main/README.md#how-to-use) را باز کنید و مراحل ارائه‌شده توسط [denuitt1](https://github.com/denuitt1) را دنبال کنید تا Deployment ID رو بگیرید. + +--- + +## ساخت از سورس + +پیش‌نیازها: + +* [Go 1.22+](https://go.dev/dl/) + +```bash +go build -ldflags "-s -w" -o mhr-cfw-go.exe ./cmd/mhr-cfw +``` + +--- + +## در حال توسعه... + +### `📊 آمار` + +* شمارنده درخواست — مجموع درخواست‌های پردازش‌شده +* میزان مصرف پهنای باند — بایت‌های ارسال/دریافت‌شده + +### `🖥️ مانیتورینگ` + +* وضعیت اتصال + +### `✏️ تجربه کاربری` + +* تعویض پروفایل — پروفایل‌های مختلف تنظیمات +* خروجی/ورودی گرفتن از config — بکاپ تنظیمات + +--- + +## گزینه‌های خط فرمان + +| Option | Description | +| ------------------ | ---------------------------------------- | +| `--no-menu` | اجرا بدون منوی TUI | +| `--port` | تغییر پورت پراکسی | +| `--host` | تغییر هاست listen | +| `--socks5-port` | تغییر پورت SOCKS5 | +| `--disable-socks5` | غیرفعال کردن پراکسی SOCKS5 | +| `--log-level` | تنظیم سطح لاگ (DEBUG, INFO, WARN, ERROR) | +| `--install-cert` | نصب CA certificate | +| `--uninstall-cert` | حذف CA certificate | +| `--scan` | اسکن IPهای Google | +| `--setup` | اجرای setup wizard | +| `--version` | نمایش نسخه | + +#### سلب مسئولیت + +* **رعایت قوانین سرویس‌های Google:** اگر از Google Apps Script یا سایر سرویس‌های Google با این پروژه استفاده می‌کنید، مسئول رعایت Terms of Service، قوانین استفاده مجاز، quotaها و سیاست‌های پلتفرم هستید. استفاده نادرست ممکن است باعث تعلیق یا حذف اکانت Google یا deploymentهای شما شود. + +--- + +## پروژه‌های اصلی + +### بر پایه [mhr-cfw](https://github.com/denuitt1/mhr-cfw)، پیاده‌سازی Python که این پروژه از روی آن بازنویسی شده است. + +## License + +MIT diff --git a/config.json b/config.json index 59cee70..1e9a15a 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,5 @@ { - "auth_key": "m97791182k", + "auth_key": "changeme", "chunked_download_chunk_size": 524288, "chunked_download_max_chunks": 256, "chunked_download_max_parallel": 8, @@ -14,7 +14,7 @@ "max_response_body_bytes": 209715200, "mode": "apps_script", "relay_timeout": 25, - "script_id": "AKfycbyhilRCuPtX9UtaLGK55m4HcoGPUQA7sB7OQdJoeLWPNU0ifZKmy6cWas7x2NHnF3_bQw", + "script_id": "changeme", "socks5_enabled": false, "socks5_port": 1080, "tcp_connect_timeout": 10,