2.2 KiB
2.2 KiB
Desktop Client
It can:
- Check whether Linux TUN support exists.
- Find
adb. - Check whether the Android VPN Share app is installed.
- Check whether the Android gateway foreground service is running.
- Bring the Android app to the foreground.
- Start the Android gateway and create
adb forward tcp:10808 tcp:10808. - Provide a local
socks5h://127.0.0.1:10808proxy endpoint. - On Linux, create a
vpnshare0TUN device and route OS traffic through the phone usingtun2socks. - Forward DNS/UDP through the Android gateway using SOCKS5 UDP-over-TCP.
It cannot yet pair with the phone over VSHP or provide native Windows/macOS TUN drivers.
Build
cargo build -p vpnshare-desktop
Run
./target/debug/vpnshare-desktop status
./target/debug/vpnshare-desktop connect
sudo ./target/debug/vpnshare-desktop system-gateway
./target/debug/vpnshare-desktop android-launch
If adb is not on PATH, point the CLI to it:
VPN_SHARE_ADB=/path/to/adb ./target/debug/vpnshare-desktop status
After connect, use the local SOCKS5 proxy with apps that support SOCKS:
ALL_PROXY=socks5h://127.0.0.1:10808 curl https://ifconfig.me
chromium --proxy-server=socks5h://127.0.0.1:10808
The socks5h form is important because DNS names are resolved through the
phone-side gateway instead of the desktop.
Linux System Gateway
For normal OS/app routing on Linux:
- Connect the phone with USB debugging enabled.
- Start the Android VPN app you want to share.
- Run
./target/debug/vpnshare-desktop connect. - Run
sudo ./target/debug/vpnshare-desktop system-gateway. - Keep the
system-gatewayprocess open while sharing.
system-gateway creates vpnshare0, starts tun2socks, installs split-default
routes (0.0.0.0/1 and 128.0.0.0/1), and configures systemd-resolved DNS on
vpnshare0 when resolvectl is available.
Cleanup command:
sudo ./target/debug/vpnshare-desktop cleanup
Next Implementation Step
The next milestone is replacing the interim SOCKS transport with the full VSHP packet tunnel:
- Connect to the Android gateway over USB/WiFi/hotspot transports.
- Pair using VSHP.
- Encrypt IP packet frames end to end.
- Add Windows/macOS packet adapters.