简体   繁体   English

使用Android VPNService转发和接收流量

[英]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. 在浏览了与android VPNService相关的所有帖子之后,我决定发布有关使用此服务进行数据包拦截的另一个问题。 So far, I managed to implement VPNService, capture outgoing packages and parse them. 到目前为止,我设法实现了VPNService,捕获了传出的程序包并对其进行了解析。 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. 在ToyVPN示例中,隧道(DatagramChannel)连接到VPN服务器。 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. 据我设法找出的VPN功能都可以在电话上实现,而无需外部VPN服务器,这正是我想要的。 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. 我认为您可能需要使VPNService充当防火墙。 This project may help: https://github.com/M66B/NetGuard 该项目可能会有所帮助: https : //github.com/M66B/NetGuard

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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