iOS-仅支持ipv4 API [英] iOS - Support ipv4 only API

查看:133
本文介绍了iOS-仅支持ipv4 API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于一个大学项目,我们正在开发一个小型App,我们希望对其进行审查,以便我们可以将其与App Store上的外部测试人员一起使用.

For a university project we're developing a small App which we'd like to get reviewed so we can use it with external testers on the App store.

但是它被拒绝了,它说它不能在仅ipv6的网络上工作.主要问题: 我们的后端服务器只能通过ipv4访问(因为我们的大学IT部门尚不希望允许ipv6),因此没有可以查询的ipv6 DNS条目. 我了解

It got declined however, stating that it couldn't work on ipv6 only networks. The main problem: Our backend server is only accessible via ipv4 (since our university IT doesn't want to allow ipv6 yet) and thus there isn't any ipv6 DNS entry that could be looked up. I understand the concept of the DNS64/NAT64 workflow as explained on https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html#//apple_ref/doc/uid/TP40010220-CH213-SW1 . However, the main DNS of our university isn't configured to work this way yet..

是否有任何方法(使用swift)来解决? 我认为我们可以以某种方式检测网络是ipv6还是ipv4,然后通过ipv6隧道(例如sixxs.org)重新路由流量?

Is there any way to work around that (using swift)? I think we could be able to somehow detect if the network is ipv6 or ipv4 and then reroute the traffic via a ipv6 tunnel such as sixxs.org?

推荐答案

它与您的后端服务器和/或学校DNS服务器无关.那些仅使用IPv4的服务器可以正常工作.您的应用需要做正确的事情才能连接到它们.

It has nothing to do with your backend server and/or school DNS server. Those being IPv4-only will work fine. It's your app that needs to do the right thing to connect to them.

您不需要检测您是在仅IPv6的网络上还是使用任何IPv6隧道.更高级别的iOS网络API已透明地与DNS64/NAT64结合使用,而无需进行任何更改.如果您使用低级套接字API,则只需在连接之前调用系统API进行查找(无论您是否在仅IPv6的网络上,都可以进行查找).

You don't need to detect whether you are on an IPv6-only network or use any IPv6 tunnels. Higher-level iOS networking APIs already transparently work with DNS64/NAT64 without any changes. If you use low-level socket APIs you just need to call a system API to do a lookup (and you can do this regardless of whether you are on an IPv6-only network or not) before you connect.

这篇关于iOS-仅支持ipv4 API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆