gpt4 book ai didi

android - 将所有互联网流量从我的 android voip 应用程序路由到我自己的 vpn 服务器

转载 作者:行者123 更新时间:2023-11-29 01:16:22 25 4
gpt4 key购买 nike

我们已经设置了自己的 VPN 服务器,并希望通过此服务器路由来 self 们 VOIP android 应用程序的所有流量。

但到目前为止我看到的所有解决方案都使用 vpn 服务类 http://developer.android.com/reference/android/net/VpnService.html ,它为整个设备创建了一个 vpn 隧道,而不仅仅是我的应用程序。我希望手机上运行的其他应用程序正常使用互联网,而我们应用程序的流量通过我们的 VPN 服务器路由。

有没有办法做到这一点?我非常感谢任何建议。谢谢

最佳答案

VpnService 不需要应用到整个设备。请参阅:VpnService.Builder.addAllowedApplication (适用于 API 21 - 5.0):

Adds an application that's allowed to access the VPN connection. If this method is called at least once, only applications added through this method (and no others) are allowed access. Else (if this method is never called), all applications are allowed by default. If some applications are added, other, un-added applications will use networking as if the VPN wasn't running.

关于android - 将所有互联网流量从我的 android voip 应用程序路由到我自己的 vpn 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39330640/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com