I am trying to use Android VPN Service for developing a communication prototype.
I went through the following tutorial :-
http://www.thegeekstuff.com/2014/06/android-vpn-service/
But I have not completely understood how to take packets from the interface and push through tunnel.
Here is what I do :-
A) Device
1) I create the interface with FileInputStream and FileOutputStream with device.
2) I create a Socket, and its corresponding DataOutputStream and DataInputStream.
B) Server
1) Server socket listening to the respective port.
2) After extracting the destination ip and port, i make a socket connection to the destination server.
Also,
1) When I a make a normal browser request from device, after the TCP handshake i see a packet with the GET Request (courtesy tcpdump), but i never see a similar packet when i make a browser request after connecting to my server through VpnService.
2) I have been able to extract destination IP and Port from the given packet easily, just the payload part is confusing me.
Can somebody help me with the Android VPN Service tutorial or a better usage example ?