explaingit

vincentng295/magic_v2ray

12JavaScriptAudience · ops devopsComplexity · 4/5Setup · hard

TLDR

A Magisk/KernelSU module for rooted Android that routes all device traffic through a proxy at the Linux kernel level, lower latency than standard VPN apps, with a local web UI for managing servers and subscriptions.

Mindmap

mindmap
  root((magic_v2ray))
    What it does
      System-level proxy
      All traffic routing
      Privacy and bypass
    How it works
      iptables and TPROXY
      Xray-core engine
      tun2socks wrapper
    Setup
      Rooted Android only
      Magisk KernelSU APatch
      Web UI for config
    Benefits
      Lower latency
      RAM-safe daemon
      Seamless network switch
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Route all Android traffic through a proxy server at the kernel level to bypass regional restrictions with lower latency than a standard VPN app.

USE CASE 2

Keep a proxy connection alive on a rooted phone even under heavy RAM pressure, since the daemon runs with system privileges.

USE CASE 3

Manage multiple proxy subscriptions from a local web interface and switch servers without manual config file editing.

USE CASE 4

Share a fast proxy connection with nearby devices by forwarding traffic from a rooted Android phone.

Tech stack

JavaScriptXray-coreiptablestun2socksMagisk

Getting it running

Difficulty · hard Time to first run · 1h+

Requires a rooted Android device with Magisk, KernelSU, or APatch, not available for non-rooted phones.

No license information was mentioned in the explanation.

In plain English

Magic V2Ray is a network proxy tool for Android phones that have been rooted. It routes all internet traffic on the device through a proxy server, which can help with privacy, bypassing regional restrictions, or sharing a fast connection with nearby devices. It is packaged as a system module for Magisk, KernelSU, or APatch, not as a regular app you install from a store. The main difference from standard Android proxy apps is how traffic is handled at the system level. Most VPN apps on Android use the operating system's built-in VPN service, which funnels all packets through a virtual network interface managed in user space. Magic V2Ray instead uses Linux kernel routing tools like iptables and TPROXY to intercept and forward packets directly, without going through the Android app layer. This approach means the proxy process runs as a background daemon with system privileges and cannot be stopped by Android's memory management when the phone runs low on RAM. Because the routing happens at the kernel level, the tool avoids the overhead of copying packets between the kernel and a Java-based app process. The README describes this as reducing latency and CPU usage compared to standard VPN apps, and notes that switching between Wi-Fi and mobile data triggers an automatic reload of routing rules without a multi-second connection gap. Configuration is managed through a web interface served locally on the device. From there you can organize proxy servers into folders, paste subscription URLs or raw configuration strings, and refresh entire groups of servers with one action. Under the hood, Magic V2Ray uses Xray-core as the proxy protocol engine and tun2socks for wrapping proxy channels when needed. Both are separate open-source projects included as pre-built binaries. If your Android device is not rooted, the README points to the official Xray-core client list for alternatives.

Copy-paste prompts

Prompt 1
I have a rooted Android phone with Magisk. Walk me through installing the Magic V2Ray module, opening the local web UI, and adding a V2Ray subscription URL so all traffic goes through my proxy.
Prompt 2
Explain how Magic V2Ray uses iptables and TPROXY to intercept Android network traffic instead of the standard VPN interface, and why that reduces latency.
Prompt 3
My Magic V2Ray connection drops when I switch from Wi-Fi to mobile data, how does the automatic routing-rule reload work, and how do I verify it's triggering correctly?
Prompt 4
Show me how to organize multiple proxy servers into folders in the Magic V2Ray web UI and bulk-refresh a subscription group.
Prompt 5
Compare Magic V2Ray's kernel-level routing to using the Xray-core Android client directly, when should I use each approach?
Open on GitHub → Explain another repo

← vincentng295 on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.