简体   繁体   中英

Forwarding and recieving traffic with Android VPNService

after going trough all the posts related to android VPNService, I decided to post yet another question regarding packet interception using this service. So far, I managed to implement VPNService, capture outgoing packages and parse them. Right now i do not know how to forward the captured data to it's initial destination. The concrete question that bothers me is (sorry for dummy question, i'm not networking expert):

In ToyVPN example, tunnel (DatagramChannel) is connected do VPN server. As far as I managed to find out VPN functions can all be implemented on the phone, without external VPN server, and its what i'm looking for. So, is this tunneling the correct way to achieve this, or should I forward the packets using ordinary methods (Sockets and such). If I should use tunnel, should I open separate tunnels for each intercepted destination? If no, which is the preferred way of forwarding packets.

I think you may need to make VPNService work as a firewall. This project may help: https://github.com/M66B/NetGuard

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM