当 iDevice 使用 3G/UMTS/Edge 时检测已建立的 VPN

发布于 2025-01-03 02:11:35 字数 259 浏览 3 评论 0原文

如果 iDevice 通过 WiFi 连接到互联网,我可以使用 kSCNetworkFlagsTransientConnection 检测 VPN 状态。效果很好。

但对于 3G/UMTS,该标志始终为真。

VPN 开/关都是 Reachability Flag Status: WR t----l-

当 iDevice 通过 3G/UMTS/EDGE 连接到互联网时,有办法检测 VPN 状态吗?

if the iDevice is connected to the internet via WiFi I'm able to detect VPN-status using kSCNetworkFlagsTransientConnection. It works fine.

But in the case of 3G/UMTS this flag is always true.

VPN on/off is both Reachability Flag Status: WR t----l- .

Is there a way to detect the VPN-status when the iDevice is connected to the internet via 3G/UMTS/EDGE ... ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暮凉 2025-01-10 02:11:35

如果这仍然有价值。我找到了一个方法来测试。至少对于 IPSec 和 Juniper 来说,VPN 连接似乎会改变设备的代理设置:

NSDictionary *dict = (__bridge NSDictionary *)(CFNetworkCopySystemProxySettings());

当 VPN 未打开时,字典有 0 项。当 VPN 打开时,dict 具有与特定 VPN 连接相关的内容。

In case this is still of value. I found a way to test. At least for IPSec and Juniper it appears that the VPN connection alters the device's proxy settings:

NSDictionary *dict = (__bridge NSDictionary *)(CFNetworkCopySystemProxySettings());

When VPN is not on, dict has 0 items. When VPN is on, dict has a content relevant to the particular vpn connection.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文