[英]Reading and forwarding data in Android VpnService
In ToyVpnService they read IP packets and then forward them to a remote VPN server. 在ToyVpnService中,他们读取IP数据包,然后将其转发到远程VPN服务器。
DatagramChannel
used with UDP only? DatagramChannel
是否仅与UDP一起使用? From what I can tell the ToyVpnService is either an experiment or in a very early stage of development. 据我所知,ToyVpnService要么是实验,要么处于开发的早期阶段。
Yes, it's only used for UDP. 是的,它仅用于UDP。 They either don't care about lost packets at this stage or they plan to implement a control mechanism later. 他们要么不在乎此阶段丢失的数据包,要么计划稍后再实施控制机制。
In the messenger example that you provide, the apps exchange strings. 在您提供的Messenger示例中,应用程序交换字符串。 They don't need to send any other info because they only want to display them. 他们不需要发送任何其他信息,因为他们只想显示它们。 When you communicate with a VPN you have to send the headers so the VPN can forward any data it receives. 与VPN通信时,必须发送标头,以便VPN可以转发其接收的任何数据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.