Skip to content

Android app seems completely broken #224

Closed

Description

@l3est

the android app doesn't work properly,

"tunnel mode" doesn't tunnel all apps, chrome is the only app that's somewhat tunneled.
others apps including youtube, instagram, telegram, ... are not effected by the android server.
same with "proxy mode".

I did everything right, and it works on pc with the same settings btw. here's what I've done:
Installed the certificate
got the google script deploy id and auth key and entered them in the app
I used the default socks proxy 127.0.0.1:1081 on telegram and there is no ping.
I also tried the http proxy on 8080 port, added both socks (127.0.0.1:1081) and http (127.0.0.1:8080) proxy to V2RayNG and did a "real delay" test and got no response.

please review the entire code related to local proxy on android.

I'm using the current version, 1.6.3

@claude @therealaleph

Activity

  1. therealaleph commented on Apr 25, 2026

    @therealaleph
    Owner

    Hi @l3est — thanks for the detailed test (V2RayNG real-delay is a useful signal because it bypasses the VPN tunnel entirely and just probes the SOCKS5/HTTP listener directly).

    Two scenarios make sense of what you're describing, and the diagnostic for each is different. Could you grab a few quick data points so we don't have to guess?

    1. Is the local listener actually bound?

    In Android Settings → Apps → mhrv-rs → notification, do you see the v1.6.3 text:

    HTTP 127.0.0.1:8080 · SOCKS5 127.0.0.1:1081

    (If it still says Routing via SOCKS5 127.0.0.1:8081, the v1.6.3 install didn't take — old APK is still running. Force-stop and reinstall.)

    If the notification text is correct, the next step is to confirm the listener is actually accepting TCP. Easiest path without root:

    • Install Termux (free, F-Droid)
    • In Termux: pkg install netcat curl once
    • Then: nc -zv 127.0.0.1 1081 && nc -zv 127.0.0.1 8080

    If those say Connection refused while mhrv-rs is "started" in the UI, the Rust runtime crashed or didn't bind — that's the actual bug to chase. If they say succeeded, the listener is up and the issue is downstream (Telegram routing, Apps Script reachability, etc.).

    2. Which mode are you running?

    • Connection mode: Tunnel or Proxy only?
    • Operating mode: apps_script, full, or google_only?

    This matters because in tunnel mode + apps_script, the TUN captures all app traffic but Apps Script only handles HTTP — non-HTTP apps (Telegram MTPROTO, YouTube native, Instagram WebSocket) can't go through. Chrome works because it's HTTP/HTTPS. If you want non-HTTP apps to work, you need full mode (which requires a tunnel-node deployed on a VPS).

    In proxy-only mode + apps_script, only apps you explicitly point at 127.0.0.1:8080/1081 use the relay, and again only HTTP traffic goes through. Telegram MTPROTO over SOCKS5 should work though, because mhrv-rs SOCKS5 listener can transport arbitrary TCP.

    3. logcat

    adb logcat -c && adb logcat | grep -iE "mhrv|MhrvVpn|cargo_proxy"
    

    Take 30 seconds of output after tapping Start, especially any Address already in use, bind failed, panic, or stack traces.


    If V2RayNG real delay is failing on both ports, my prior on what's happening: the Rust runtime panicked on startup (#211 area code is fresh, possible regression from another path). The logcat will show it. Don't change settings between reproductions — same config that's currently failing, just give us the log of one attempt.

    Also @internash98's #223 looks like the same case in Persian — let's keep diagnostic data here in #224 and I'll cross-link.


    [reply via Anthropic Claude | reviewed by @therealaleph]

  2. w0l4i commented on Apr 26, 2026

    @w0l4i

    the android app doesn't work properly,

    "tunnel mode" doesn't tunnel all apps, chrome is the only app that's somewhat tunneled. others apps including youtube, instagram, telegram, ... are not effected by the android server. same with "proxy mode".

    I did everything right, and it works on pc with the same settings btw. here's what I've done: Installed the certificate got the google script deploy id and auth key and entered them in the app I used the default socks proxy 127.0.0.1:1081 on telegram and there is no ping. I also tried the http proxy on 8080 port, added both socks (127.0.0.1:1081) and http (127.0.0.1:8080) proxy to V2RayNG and did a "real delay" test and got no response.

    please review the entire code related to local proxy on android.

    I'm using the current version, 1.6.3

    @claude @therealaleph

    USE FULL MODE TO FIX ALL YOUR ISSUES

    with full mode no need to install mitm cert etc .. you just need a cheap vps and a little bit network knowledge that's all

    https://github.com/therealaleph/MasterHttpRelayVPN-RUST/tree/main/tunnel-node

  3. l3est commented on Apr 26, 2026

    @l3est
    Author

    Hi @l3est — thanks for the detailed test (V2RayNG real-delay is a useful signal because it bypasses the VPN tunnel entirely and just probes the SOCKS5/HTTP listener directly).

    Two scenarios make sense of what you're describing, and the diagnostic for each is different. Could you grab a few quick data points so we don't have to guess?

    1. Is the local listener actually bound?

    In Android Settings → Apps → mhrv-rs → notification, do you see the v1.6.3 text:

    HTTP 127.0.0.1:8080 · SOCKS5 127.0.0.1:1081

    (If it still says Routing via SOCKS5 127.0.0.1:8081, the v1.6.3 install didn't take — old APK is still running. Force-stop and reinstall.)

    If the notification text is correct, the next step is to confirm the listener is actually accepting TCP. Easiest path without root:

    • Install Termux (free, F-Droid)
    • In Termux: pkg install netcat curl once
    • Then: nc -zv 127.0.0.1 1081 && nc -zv 127.0.0.1 8080

    If those say Connection refused while mhrv-rs is "started" in the UI, the Rust runtime crashed or didn't bind — that's the actual bug to chase. If they say succeeded, the listener is up and the issue is downstream (Telegram routing, Apps Script reachability, etc.).

    2. Which mode are you running?

    • Connection mode: Tunnel or Proxy only?
    • Operating mode: apps_script, full, or google_only?

    This matters because in tunnel mode + apps_script, the TUN captures all app traffic but Apps Script only handles HTTP — non-HTTP apps (Telegram MTPROTO, YouTube native, Instagram WebSocket) can't go through. Chrome works because it's HTTP/HTTPS. If you want non-HTTP apps to work, you need full mode (which requires a tunnel-node deployed on a VPS).

    In proxy-only mode + apps_script, only apps you explicitly point at 127.0.0.1:8080/1081 use the relay, and again only HTTP traffic goes through. Telegram MTPROTO over SOCKS5 should work though, because mhrv-rs SOCKS5 listener can transport arbitrary TCP.

    3. logcat

    adb logcat -c && adb logcat | grep -iE "mhrv|MhrvVpn|cargo_proxy"
    

    Take 30 seconds of output after tapping Start, especially any Address already in use, bind failed, panic, or stack traces.

    If V2RayNG real delay is failing on both ports, my prior on what's happening: the Rust runtime panicked on startup (#211 area code is fresh, possible regression from another path). The logcat will show it. Don't change settings between reproductions — same config that's currently failing, just give us the log of one attempt.

    Also @internash98's #223 looks like the same case in Persian — let's keep diagnostic data here in #224 and I'll cross-link.

    [reply via Anthropic Claude | reviewed by @therealaleph]

    1. I checked the version from the settings, it says 1.6.3
      I can't install packages right now, there is no internet

    2. I tried all combinations, tunnel mode + app script is the only one that almost works. I can access youtube for exmaple in chrome but it won't play videos.

    3. the adb logcat -c && adb logcat | grep -iE "mhrv|MhrvVpn|cargo_proxy" command result:

    At line:1 char:15
    + adb logcat -c && adb logcat | grep -iE "mhrv|MhrvVpn|cargo_proxy"
    +               ~~
    The token '&&' is not a valid statement separator in this version.
       + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
       + FullyQualifiedErrorId : InvalidEndOfLine

    also I tried "tcp ping" in v2rayng and both phone server (socks 127.0.0.1:8081) and pc server (http 192.168.1.110:8085) got a response, so it's definitely not the firewall.

    Image

    ignore 9910 port, it's for v2rayn on windows

  4. Evolve6996 commented on Apr 26, 2026

    @Evolve6996

    hello i cannot use android app aswell everything works on pc but in adnroid with the same config, nothing works. no app has access to internet. telegram either in tun mode or proxy mode not working

  5. therealaleph commented on Apr 26, 2026

    @therealaleph
    Owner

    try again

  6. o0Fara0o commented on Apr 27, 2026

    @o0Fara0o

    Me to . everything works on pc but sock5 on Android sucks.no telegram

  7. o0Fara0o commented on Apr 27, 2026

    @o0Fara0o

    Me to . everything works on pc but sock5 on Android sucks.no telegram

  8. therealaleph commented on Apr 27, 2026

    @therealaleph
    Owner

    @o0Fara0o — for Telegram on Android with apps_script mode, the symptom you're describing (PC works, Android socks5 doesn't) is the recurring architectural case explained in detail across #259, #273, #225, #239, #251, etc.

    Short version of why:

    • Telegram MTPROTO is not HTTP and not TLS
    • Apps Script can only tunnel HTTP/HTTPS
    • mhrv-rs dispatches MTPROTO to raw-tcp (direct) → direct connection from your phone to Telegram IPs → ISP filters those IPs → fail

    PC works because either (a) you have another VPN running on the PC providing the egress for raw-tcp-direct, or (b) your PC's ISP path is different from the Android's mobile network.

    Three working paths for Telegram on Android:

    1. Telegram MTProto official proxy (@MTProxybot — free, doesn't need mhrv-rs at all)
    2. Telegram Web in Android Chrome (HTTPS, goes through the relay)
    3. Full mode + VPS (handles arbitrary TCP, including MTPROTO)

    There's nothing apps_script mode can do to make Telegram MTPROTO work on a filtered ISP — this is a fundamental Apps Script limitation, not a config issue.


    [reply via Anthropic Claude | reviewed by @therealaleph]

  9. Evolve6996 commented on Apr 27, 2026

    @Evolve6996

    try again

    i got new version of apk, me and my friend cannot use android version its only open youtube thumbnails not the video, isp for pc and android is same, telegram desktop works fine but telegram app is not maybe telegram desktop app is more compatibale with mhrv. we have xia and sammy

  10. therealaleph commented on Apr 27, 2026

    @therealaleph
    Owner

    @Evolve6996 — to narrow down the Android-only issue, three quick questions:

    1. Connection mode in the Android app: Tunnel or Proxy only?
    2. If Proxy only: did you set proxy in your Android browser/apps to 127.0.0.1:8080 (HTTP) or 127.0.0.1:1081 (SOCKS5)?
    3. If Tunnel: did you grant VpnService permission when prompted? Does the foreground notification show "HTTP 127.0.0.1:8080 · SOCKS5 127.0.0.1:1081"?

    The pattern "PC works, Android doesn't" with the same script_id + auth_key is almost always one of:

    • Tunnel mode + VpnService permission denied → no traffic captured → nothing works
    • Proxy only + browser/app not configured → traffic bypasses mhrv-rs → ISP filters it normally
    • Tunnel mode + Full mode + udpgw DNS clash (my hypothesis from #251) — DNS queries get misrouted

    The first two are setup issues fixable in the app. The third is a real bug we'd need to track.

    adb logcat | grep -iE "mhrv|MhrvVpn|tun2proxy" for 30 seconds after Connect on Android tells us which one. Failing that, screenshots of mhrv-rs Android settings (Connection mode + Operating mode dropdowns visible) work too.


    [reply via Anthropic Claude | reviewed by @therealaleph]

  11. Evolve6996 commented on Apr 27, 2026

    @Evolve6996

    @Evolve6996 — to narrow down the Android-only issue, three quick questions:

    1. Connection mode in the Android app: Tunnel or Proxy only?
    2. If Proxy only: did you set proxy in your Android browser/apps to 127.0.0.1:8080 (HTTP) or 127.0.0.1:1081 (SOCKS5)?
    3. If Tunnel: did you grant VpnService permission when prompted? Does the foreground notification show "HTTP 127.0.0.1:8080 · SOCKS5 127.0.0.1:1081"?

    The pattern "PC works, Android doesn't" with the same script_id + auth_key is almost always one of:

    • Tunnel mode + VpnService permission denied → no traffic captured → nothing works
    • Proxy only + browser/app not configured → traffic bypasses mhrv-rs → ISP filters it normally
    • Tunnel mode + Full mode + udpgw DNS clash (my hypothesis from #251) — DNS queries get misrouted

    The first two are setup issues fixable in the app. The third is a real bug we'd need to track.

    adb logcat | grep -iE "mhrv|MhrvVpn|tun2proxy" for 30 seconds after Connect on Android tells us which one. Failing that, screenshots of mhrv-rs Android settings (Connection mode + Operating mode dropdowns visible) work too.

    [reply via Anthropic Claude | reviewed by @therealaleph]

    thanks i found the issue and youtube worked. but still telegram app in android not working i think its not fixable without full tunnel ty btw

  12. therealaleph commented on Apr 27, 2026

    @therealaleph
    Owner

    @Evolve6996 — glad YouTube is working now! Closing the YouTube part of this.

    Telegram Android over Apps Script mode (no Full mode):

    You're right, this isn't fully fixable in Apps Script mode alone. Here's why:

    Telegram mobile uses MTProto which is a custom binary protocol over TCP/UDP — not HTTPS. The mhrv-rs MITM-relay layer only handles HTTPS traffic (it terminates TLS, sends the cleartext-after-TLS through Apps Script, re-encrypts on the other side). Non-HTTPS connections like MTProto have no decryptable layer to relay through Apps Script's UrlFetchApp.fetch().

    What this means in practice:

    • Telegram's TLS-based fallback (the one used when MTProto is blocked) does work over mhrv-rs Apps Script mode in many cases, but it's slow (each message round-trips through Apps Script).
    • Telegram's primary MTProto path doesn't go through mhrv-rs at all in Apps Script mode — it tries direct connection, gets ISP-blocked, and fails.

    Three options for Telegram on Android:

    1. Full mode + VPS (most reliable) — tunnel-node forwards raw TCP/UDP from a clean VPS IP. Telegram MTProto goes through unchanged. Best UX for Telegram specifically.

    2. Telegram MTProto Proxy — Telegram has built-in support for MTProto proxies (Settings → Data and Storage → Proxy → Add Proxy → MTProto). These are public proxies you can find in @MTProtoProxy_bot or various Telegram channels. Doesn't need mhrv-rs at all for Telegram traffic. Most Telegram users in censored regions do this.

    3. mhrv-rs Tunnel mode (Android VPN) + waiting for Telegram client to retry over TLS — sometimes works when Telegram falls back to TLS-encapsulated MTProto, which mhrv-rs can carry. Inconsistent.

    Most users in your situation run MTProto Proxy for Telegram + mhrv-rs for everything else. Each tool for its intended job.

    If you'd specifically like mhrv-rs Full mode set up, see the tunnel-node docs: https://github.com/therealaleph/MasterHttpRelayVPN-RUST/tree/main/tunnel-node. Cheap VPS (Hetzner €4/mo or similar) + 5-minute setup.

    I'll close this issue since the original report (YouTube) is resolved. For Telegram Android over Full mode, please open a fresh issue if you set up a VPS and still see problems — that gives us a clean diagnostic surface.


    [reply via Anthropic Claude | reviewed by @therealaleph]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions