Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions config.direct.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@ mode = "direct"
[network]
google_ip = "216.239.38.120"
front_domain = "www.google.com"
# Local-only by default. For LAN sharing, set listen_host = "0.0.0.0" and
# either configure [network.proxy_auth] or set allow_unauthenticated_lan = true
# for a trusted home LAN/personal hotspot.
listen_host = "127.0.0.1"
allow_unauthenticated_lan = false
listen_port = 8085
socks5_port = 8086
verify_ssl = true

# [network.proxy_auth]
# username = "mhrv"
# password = "CHANGE_ME"

[network.hosts]

[scan]
Expand Down
8 changes: 8 additions & 0 deletions config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,19 @@ auth_key = "CHANGE_ME_TO_A_STRONG_SECRET"
[network]
google_ip = "216.239.38.120"
front_domain = "www.google.com"
# Local-only by default. For LAN sharing, set listen_host = "0.0.0.0" and
# either configure [network.proxy_auth] or set allow_unauthenticated_lan = true
# for a trusted home LAN/personal hotspot.
listen_host = "127.0.0.1"
allow_unauthenticated_lan = false
listen_port = 8085
socks5_port = 8086
verify_ssl = true

# [network.proxy_auth]
# username = "mhrv"
# password = "CHANGE_ME"

[network.hosts]

[scan]
Expand Down
12 changes: 10 additions & 2 deletions config.exit-node.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@ auth_key = "PUT_YOUR_APPS_SCRIPT_AUTH_KEY_HERE"
[network]
google_ip = "216.239.38.120"
front_domain = "www.google.com"
listen_host = "0.0.0.0"
# Local-only by default. For LAN sharing, set listen_host = "0.0.0.0" and
# either configure [network.proxy_auth] or set allow_unauthenticated_lan = true
# for a trusted home LAN/personal hotspot.
listen_host = "127.0.0.1"
allow_unauthenticated_lan = false
listen_port = 8085
socks5_port = 8086
verify_ssl = true

# [network.proxy_auth]
# username = "mhrv"
# password = "CHANGE_ME"

[network.hosts]

[scan]
Expand Down Expand Up @@ -44,4 +52,4 @@ hosts = [
"openai.com",
"aistudio.google.com",
"ai.google.dev",
]
]
8 changes: 8 additions & 0 deletions config.fronting-groups.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@ mode = "direct"
[network]
google_ip = "216.239.38.120"
front_domain = "www.google.com"
# Local-only by default. For LAN sharing, set listen_host = "0.0.0.0" and
# either configure [network.proxy_auth] or set allow_unauthenticated_lan = true
# for a trusted home LAN/personal hotspot.
listen_host = "127.0.0.1"
allow_unauthenticated_lan = false
listen_port = 8085
socks5_port = 8086
verify_ssl = true

# [network.proxy_auth]
# username = "mhrv"
# password = "CHANGE_ME"

[network.hosts]

[scan]
Expand Down
8 changes: 8 additions & 0 deletions config.full.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,19 @@ auth_key = "CHANGE_ME_TO_A_STRONG_SECRET"
[network]
google_ip = "216.239.38.120"
front_domain = "www.google.com"
# Local-only by default. For LAN sharing, set listen_host = "0.0.0.0" and
# either configure [network.proxy_auth] or set allow_unauthenticated_lan = true
# for a trusted home LAN/personal hotspot.
listen_host = "127.0.0.1"
allow_unauthenticated_lan = false
listen_port = 8085
socks5_port = 8086
verify_ssl = true

# [network.proxy_auth]
# username = "mhrv"
# password = "CHANGE_ME"

[network.hosts]

[scan]
Expand Down
35 changes: 32 additions & 3 deletions docs/guide.fa.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,36 @@ HTTP / HTTPS مثل قبل از Apps Script می‌رود (تغییری نمی

## اشتراک‌گذاری هات‌اسپات

mhrv-rs به‌طور پیش‌فرض روی `0.0.0.0` گوش می‌دهد، پس هر دستگاه روی همان شبکه می‌تواند ازش استفاده کند. سناریوی رایج: اشتراک تونل از گوشی اندروید به آیفون / آیپد / لپ‌تاپ از هات‌اسپات:
mhrv-rs به‌طور پیش‌فرض فقط روی `127.0.0.1` گوش می‌دهد، یعنی فقط برنامه‌های همان دستگاه می‌توانند از proxy استفاده کنند. برای اشتراک‌گذاری با گوشی، تبلت، لپ‌تاپ یا روتر خانه، `listen_host` را به `0.0.0.0` تغییر بده و یکی از دو حالت LAN را انتخاب کن:

- **اشتراک‌گذاری LAN با احراز هویت**: `[network.proxy_auth]` را تنظیم کن. کلاینت HTTP باید `Proxy-Authorization: Basic ...` بفرستد و کلاینت SOCKS5 باید username/password داشته باشد. این حالت برای Wi-Fi مشترک، خوابگاه، محل کار، کتابخانه، و هر هات‌اسپاتی که همهٔ دستگاه‌های وصل‌شده‌اش دست خودت نیستند پیشنهاد می‌شود.
- **اشتراک‌گذاری LAN باز و مطمئن**: `allow_unauthenticated_lan = true` را بگذار. این همان workflow راحت قدیمی برای LAN خانه یا هات‌اسپات شخصی است. هر دستگاهی که به پورت proxy برسد می‌تواند از quota Apps Script و تونل تو استفاده کند، پس روی شبکهٔ مشترک روشنش نکن.

UI هر دو حالت را نشان می‌دهد. بعد از Save، همان حالت برای اجراهای بعدی پیش‌فرض می‌شود؛ هر وقت خواستی به حالت امن‌تر برگردی، گزینه را خاموش کن و دوباره Save بزن.

نمونهٔ TOML:

```toml
[network]
listen_host = "0.0.0.0"
listen_port = 8085
socks5_port = 8086
allow_unauthenticated_lan = false

[network.proxy_auth]
username = "home"
password = "CHANGE_ME"
```

برای خانه/هات‌اسپات خصوصی بدون credential:

```toml
[network]
listen_host = "0.0.0.0"
allow_unauthenticated_lan = true
```

workflow پایهٔ هات‌اسپات:

۱. **اندروید:** هات‌اسپات موبایل را روشن کن + اپ را استارت کن
۲. **دستگاه دیگر:** به Wi-Fi هات‌اسپات اندروید وصل شو
Expand All @@ -287,7 +316,7 @@ Settings → Wi-Fi → روی (i) شبکهٔ هات‌اسپات بزن → Conf

HTTP proxy سیستم را روی `192.168.43.1:8080` بگذار، یا per-app SOCKS5 روی `192.168.43.1:1081`.

> اگر `listen_host` در کانفیگت `127.0.0.1` است، به `0.0.0.0` تغییرش بده تا اتصال از دستگاه‌های دیگر را بپذیرد.
اگر LAN با احراز هویت روشن است، username/password تنظیم‌شده را در تنظیمات proxy کلاینت وارد کن. اگر کلاینت فقط proxy بدون احراز هویت را پشتیبانی می‌کند، حالت LAN باز را فقط روی شبکه‌ای روشن کن که کنترلش دست خودت است.

## اجرا روی OpenWRT

Expand All @@ -306,7 +335,7 @@ chmod +x /usr/bin/mhrv-rs /etc/init.d/mhrv-rs
logread -e mhrv-rs -f # تمام لاگ
```

دستگاه‌های LAN HTTP proxy را روی IP روتر (پورت پیش‌فرض `8085`) یا SOCKS5 روی `<router-ip>:8086` تنظیم می‌کنند. در `/etc/mhrv-rs/config.toml` مقدار `listen_host` را به `0.0.0.0` بگذار تا روتر اتصال LAN را بپذیرد.
OpenWRT می‌تواند proxy کل LAN باشد: در `/etc/mhrv-rs/config.toml` مقدار `listen_host = "0.0.0.0"` را بگذار. اگر افراد دیگر هم می‌توانند به LAN وصل شوند، `[network.proxy_auth]` را تنظیم کن. برای شبکهٔ خصوصی خانه که عمداً رفتار بدون رمز قدیمی را می‌خواهی، `allow_unauthenticated_lan = true` را بگذار.

مصرف حافظه ~۱۵–۲۰ مگابایت — روی هر روتری با ۱۲۸ مگابایت RAM به بالا اجرا می‌شود. UI روی musl نیست (روترها headlessاند).

Expand Down
35 changes: 32 additions & 3 deletions docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,36 @@ The destination sees the exit node's IP, not Google's, so the anti-bot heuristic

## Sharing via hotspot

mhrv-rs listens on `0.0.0.0` by default, so any device on the same network can use it. Common scenario: share the tunnel from an Android phone to an iPhone, iPad, or laptop over hotspot:
mhrv-rs listens on `127.0.0.1` by default, so only apps on the same device can use the HTTP/SOCKS proxy. To share the proxy with another phone, tablet, laptop, or a home router, switch the bind address to `0.0.0.0` and choose one of two persisted LAN modes:

- **Authenticated LAN sharing**: configure `[network.proxy_auth]`. HTTP clients must send `Proxy-Authorization: Basic ...`; SOCKS5 clients must use username/password authentication. This is the recommended mode on shared Wi-Fi, dorm networks, offices, libraries, and any hotspot where you do not fully control every connected device.
- **Open trusted-LAN sharing**: set `allow_unauthenticated_lan = true`. This keeps the old frictionless hotspot workflow for a trusted home LAN or personal hotspot. Anyone who can reach the proxy port can use your Apps Script quota and tunnel, so leave this off on shared networks.

The UI exposes both modes. After you save, the selected mode becomes the default for future launches; switch it back and save again whenever you need to return to the safer authenticated mode.

TOML example:

```toml
[network]
listen_host = "0.0.0.0"
listen_port = 8085
socks5_port = 8086
allow_unauthenticated_lan = false

[network.proxy_auth]
username = "home"
password = "CHANGE_ME"
```

For a private home/hotspot setup without credentials:

```toml
[network]
listen_host = "0.0.0.0"
allow_unauthenticated_lan = true
```

Basic hotspot workflow:

1. **Android:** enable mobile hotspot + start the app
2. **Other device:** connect to the Android hotspot Wi-Fi
Expand All @@ -287,7 +316,7 @@ For full device-wide coverage on iOS, use [Shadowrocket](https://apps.apple.com/

Set system HTTP proxy to `192.168.43.1:8080`, or per-app SOCKS5 to `192.168.43.1:1081`.

> If `listen_host` is `127.0.0.1` in your config, change to `0.0.0.0` to allow other devices.
If authenticated LAN sharing is enabled, enter the configured username/password in the client proxy settings. If the client only supports unauthenticated proxies, use open trusted-LAN mode only on a network you control.

## Running on OpenWRT

Expand All @@ -306,7 +335,7 @@ chmod +x /usr/bin/mhrv-rs /etc/init.d/mhrv-rs
logread -e mhrv-rs -f # tail logs
```

LAN devices then point HTTP proxy at the router's LAN IP (default port `8085`) or SOCKS5 at `<router-ip>:8086`. Set `listen_host` to `0.0.0.0` in `/etc/mhrv-rs/config.toml` so the router accepts LAN connections.
OpenWRT can act as a LAN-wide proxy by setting `listen_host = "0.0.0.0"` in `/etc/mhrv-rs/config.toml`. Use `[network.proxy_auth]` when other people can join the LAN. For a private home network where you intentionally want the old no-password behavior, set `allow_unauthenticated_lan = true`.

Memory footprint ~15–20 MB resident — fine on anything ≥128 MB RAM. No UI on musl (routers are headless).

Expand Down
Loading
Loading