A bit of background
I have an Android phone, which unfortunately cannot usb-tether while it is connected to the internet (using wifi or mobile data, but it works when the device is not connected to the internet. Wifi and Bluetooth tethering have this problem too). Now I want to connect my PC to the internet using my android phone (using only wired connection).
The unideal solution
I came up with a rather hacky solution which has a minor problem: I compiled gost - a proxy server - for my device (FYI, I used GOOS=linux GOARCH=arm
environmental variables to build the binary) and ran the binary on my Android phone on port 8080
(I placed the binary in /data/local/tmp
. I ran it the obvious way using adb shell
without superuser privileges). Then I used adb forward tcp:8080 tcp:8080
to forward device's port 8080
to my PC's port 8080
. After that I used localhost:8080
as a socks5 proxy on my PC and could access the internet.
The problem is that I cannot use certain applications as they don't support connecting through proxy (some of them run on a lower network layer than a socks5 proxy, so there is no way for them to work).
My question
Is there any way to run a VPN server on my Android phone (which conveniently has root access too) and use it like the way I currently do? If so, I'm only interested in solutions using well-maintained opensource software.