I am trying to create a VPN client on Android. I looked at the ToyVpn android application, I tried to connect to my PC (Windows 7) from this application, but I get a port exception that is not available.
E/ToyVpnService(2302): Got java.net.PortUnreachableException: E/ToyVpnService(2302): Got java.net.SocketException: sendto failed: ECONNREFUSED (Connection refused)
But when I connect to my computer through the default vpn client for vpn for Android, it connects successfully. And by typing "netstat" on the command line, I noticed that my PC port 1723 is connected to telephone port 36302. Thus, the output port is available.
This is an example application, it should work ... But I saw some other links that mentioned that they cannot connect to the server through this application.
Does this sample work at all? Is this root phone API needed?
Other than that, I did not find a single example or tutorial to show the correct use of "android.net.VpnService".
Can anyone advise me on this ..?
source share