How to test iOS app is it supporting IPv6? [closed]

China☆狼群 提交于 2019-12-21 07:22:17

问题


I have apps, built 2015 and 2014. How can I test them for IPv6?
If my apps doesn't support IPv6, what should I do?

My apps are using AFNetworking and Alamofire. I'm connecting mostly to domains ( Ex. api.example.com/v1/...). Only 1 app use IP: (ex: 12.12.12.12:3000/api/v1/...).

Is there problem for websockets? (ws://12.12.12.12:8080/api/....).


回答1:


It is hard to say with any certainty without knowing more about your app. Specifically:

  • Are you using IP addresses directly?
  • Are you allowing users to enter them directly in some form other than in a URL?
  • Are you making network connections directly using APIs other than Apple's NSURL-based APIs?
  • Are you explicitly doing DNS lookups yourself for any reason?

If the answer to all of these four questions is "no", then you don't need to make any changes to support IPv6.

When using IP addresses directly, if the user needs to be able to enter those addresses, you'll probably want to add code to allow the user to enter IPv6 addresses as well, and resolve them appropriately.

If your code is performing DNS resolution on its own and then doing something with the IP addresses, it must be updated to handle IP addresses and to pass them properly to whatever API you're calling with IP addresses.

Hardcoded IP addresses are a problem. You need to create a hostname for these IP addresses. That way, the device's DNS resolver can do various magic to create a fake IPv6 address that results in network address translation to the real IPv4 address by a router somewhere.

As far as I know, AFNetworking 3.0 and later should be fine, as should recent versions of AlamoFire. Be sure you're up-to-date.



来源:https://stackoverflow.com/questions/37096725/how-to-test-ios-app-is-it-supporting-ipv6

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!