You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-26Lines changed: 24 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -163,7 +163,7 @@ Firefox keeps its own cert store; the installer also drops the CA into Firefox's
163
163
164
164
Open the UI and fill in the form:
165
165
166
-
-**Apps Script ID** — the Deployment ID from Step 1. Add multiple IDs (one per line in the UI, or a JSON array in `config.json`) for higher quota **and** lower latency. In `apps_script` mode, IDs are round-robined. In `full` mode, more IDs directly increase the pipeline depth (see [Full tunnel mode](#full-tunnel-mode) below).
166
+
-**Apps Script ID** — the Deployment ID from Step 1. Add multiple IDs (one per line in the UI, or a JSON array in `config.json`) for higher quota **and** lower latency. In `apps_script` mode, IDs are round-robined. In `full` mode, each deployment gets its own pool of 30 concurrent requests (the Apps Script per-account limit), so more IDs = more total throughput (see [Full tunnel mode](#full-tunnel-mode) below).
167
167
-**Auth key** — the same secret you set in `Code.gs`.
168
168
-**Google IP** — `216.239.38.120` is a solid default. Use the **scan** button to probe for a faster one from your network.
169
169
-**Front domain** — keep `www.google.com`.
@@ -271,21 +271,20 @@ Full tunnel mode (`"mode": "full"`) routes **all** traffic end-to-end through Ap
271
271
272
272
### How deployment IDs affect performance
273
273
274
-
Each Apps Script batch request takes ~2 seconds round-trip. In full mode, `mhrv-rs` runs a **pipelined batch multiplexer** that fires multiple batch requests concurrently without waiting for the previous one to return. The number of in-flight batches (the *pipeline depth*) scales directly with the number of deployment IDs you configure:
274
+
Each Apps Script batch request takes ~2 seconds round-trip. In full mode, `mhrv-rs` runs a **pipelined batch multiplexer** that fires multiple batch requests concurrently without waiting for the previous one to return. Each deployment ID (= one Google account) gets its own concurrency pool of **30 in-flight requests** — matching the Apps Script per-account execution limit.
| 1 | 30 | Single account — plenty for light browsing |
283
+
| 3 | 90 | Good for daily use |
284
+
| 6 | 180 | Recommended for heavy use |
285
+
| 12 | 360 | Multi-account power setup |
287
286
288
-
More deployments = more concurrent batches = lower per-session latency. Each batch round-robins across your deployment IDs, so the load is spread evenly and you're less likely to hit a single deployment's quota ceiling.
287
+
More deployments = more total concurrency = lower per-session latency. Each batch round-robins across your deployment IDs, so the load is spread evenly and you're less likely to hit a single deployment's quota ceiling.
289
288
290
289
**Resource guards** keep things safe:
291
290
-**50 ops max** per batch — if more sessions are active, the mux splits into multiple batches
@@ -294,10 +293,10 @@ More deployments = more concurrent batches = lower per-session latency. Each bat
294
293
295
294
### Quick start
296
295
297
-
1. Deploy [`CodeFull.gs`](assets/apps_script/CodeFull.gs) as **3–12 Web App deployments** (same steps as `Code.gs`, but use the full-mode script that forwards to your tunnel-node). You can create multiple deployments on a single Google account — each "New deployment" produces its own ID. Going multi-account only matters for the daily quota (each Google account gets its own 20 000 `UrlFetchApp` calls/day on the free tier / 100 000 on Workspace); the pipeline depth itself scales fine on one account up to Apps Script's simultaneous-execution ceiling. Rule of thumb:
298
-
-**Solo use** → 3–6 deployments on one account is plenty
299
-
-**Shared with ~3 people** → 6 deployments on one account, bump to multi-account only if you start hitting quota alerts
300
-
-**Shared with a group** → one account per heavy user (each with 1–2 deployments) is the clean scaling path
296
+
1. Deploy [`CodeFull.gs`](assets/apps_script/CodeFull.gs) as a **Web App deployment**on each Google account (same steps as `Code.gs`, but use the full-mode script that forwards to your tunnel-node). Use **one deployment per Google account** — the 30-concurrent-request limit is per account, so multiple deployments on the same account share the same pool and don't add concurrency. To scale, add more accounts:
297
+
-**Solo use** → 1–2 accounts is plenty
298
+
-**Shared with ~3 people** → 3 accounts
299
+
-**Shared with a group** → one account per heavy user
301
300
2. Deploy the [tunnel-node](tunnel-node/) on a VPS
302
301
3. Set `"mode": "full"` in your config with all deployment IDs:
303
302
@@ -630,21 +629,20 @@ Donations cover hosting, self-hosted CI runner costs, and continued maintenance.
630
629
631
630
#### چرا تعداد `Deployment ID` مهم است؟
632
631
633
-
هر درخواست دستهای (`batch`) به `Apps Script` حدود ۲ ثانیه طول میکشد. در حالت `full`، برنامه یک **لولهٔ موازی** (`pipeline`) اجرا میکند که چند درخواست دستهای را همزمان میفرستد بدون اینکه منتظر پاسخ قبلی بماند. تعداد درخواستهای همزمان مستقیماً با تعداد `Deployment ID`ها رابطه دارد:
632
+
هر درخواست دستهای (`batch`) به `Apps Script` حدود ۲ ثانیه طول میکشد. در حالت `full`، برنامه یک **لولهٔ موازی** (`pipeline`) اجرا میکند که چند درخواست دستهای را همزمان میفرستد بدون اینکه منتظر پاسخ قبلی بماند. هر `Deployment ID` (= یک حساب گوگل) حوضچهٔ همزمانی مخصوص خودش با **۳۰ درخواست همزمان** دارد — مطابق سقف اجرای همزمان `Apps Script` به ازای هر حساب.
634
633
635
634
```
636
-
عمق لوله = تعداد Deployment IDها (حداقل ۲)
635
+
حداکثر همزمانی = ۳۰ × تعداد Deployment IDها
637
636
```
638
637
639
-
| تعداد Deployment | عمق لوله | فاصلهٔ مؤثر بین دستهها ||
بیشتر `Deployment` = بیشتر درخواست همزمان = تأخیر کمتر برای هر نشست. هر دسته بین `ID`ها چرخش میکند (`round-robin`)، پس بار بهطور یکنواخت توزیع میشود.
645
+
بیشتر `Deployment` = بیشتر همزمانی = تأخیر کمتر برای هر نشست. هر دسته بین `ID`ها چرخش میکند (`round-robin`)، پس بار بهطور یکنواخت توزیع میشود.
648
646
649
647
### اجرا روی OpenWRT (روتر)
650
648
@@ -700,7 +698,7 @@ logread -e mhrv-rs -f
700
698
-**لینوکس:** فایل `/usr/local/share/ca-certificates/mhrv-rs.crt` را حذف و `sudo update-ca-certificates` اجرا کنید
701
699
702
700
**چند `Deployment ID` لازم دارم؟**
703
-
یکی برای استفادهٔ عادی کافی است. سهمیهٔ روزانه `UrlFetchApp` برای حساب رایگان گوگل **۲۰٬۰۰۰ درخواست در روز** است (برای `Workspace` پولی ۱۰۰٬۰۰۰)، با محدودیت پاسخ ۵۰ مگابایت به ازای هر `fetch`. برای اکثر کاربران چند ساعت یوتیوب هم با یک `Deployment` کافی است. میتوانید چند `Deployment` **در همان حساب** بسازید (هر بار `New deployment` یک `ID` جدید میدهد) — این روش در حالت `full` پهنای باند بهتری میدهد چون `pipeline depth` افزایش پیدا میکند و هر `Deployment` یک اجرای همزمان جدا در `Apps Script` میگیرد (تا سقف ۳۰ اجرای همزمان هر حساب). برای سهمیهٔ روزانهٔ بیشتر، در حسابهای گوگل دیگر هم `Deployment` بسازید — هر حساب سهمیهٔ ۲۰ هزار درخواستی خودش را دارد. همهٔ `ID`ها را در فیلد `Apps Script ID(s)` وارد کنید — برنامه خودکار بینشان میچرخد. مرجع: <https://developers.google.com/apps-script/guides/services/quotas>
701
+
یکی برای استفادهٔ عادی کافی است. سهمیهٔ روزانه `UrlFetchApp` برای حساب رایگان گوگل **۲۰٬۰۰۰ درخواست در روز** است (برای `Workspace` پولی ۱۰۰٬۰۰۰)، با محدودیت پاسخ ۵۰ مگابایت به ازای هر `fetch`. از هر حساب گوگل **فقط یک `Deployment`**بسازید — سقف ۳۰ درخواست همزمان به ازای هر حساب است، پس چند `Deployment`روی یک حساب همزمانی اضافه نمیکند. برای افزایش همزمانی یا سهمیهٔ روزانه، در حسابهای گوگل دیگر `Deployment` بسازید — هر حساب سهمیهٔ ۲۰ هزار درخواستی و ۳۰ اجرای همزمان خودش را دارد. همهٔ `ID`ها را در فیلد `Apps Script ID(s)` وارد کنید — برنامه خودکار بینشان میچرخد. مرجع: <https://developers.google.com/apps-script/guides/services/quotas>
704
702
705
703
**یوتوب کار میکند؟ ویدیو پخش میشود؟**
706
704
صفحهٔ یوتوب سریع باز میشود (چون مستقیم از لبهٔ گوگل میآید). اما `chunk`های ویدیوی اصلی از `googlevideo.com` از طریق `Apps Script` میآیند و روزانه سهمیه دارند. برای تماشای گاهبهگاه خوب است، برای ۱۰۸۰p پخش طولانی دردناک.
0 commit comments