如何测试iOS应用程序是否支持IPv6? [英] How to test iOS app is it supporting IPv6?

查看:149
本文介绍了如何测试iOS应用程序是否支持IPv6?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2015年和2014年构建的应用程序。如何针对IPv6测试它们?

如果我的应用程序不支持IPv6,我该怎么办?

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?

我的应用程序正在使用AFNetworking和Alamofire。我主要连接到域(例如api.example.com/v1 / ...)。只有1个应用程序使用IP :(例如:12.12.12.12:3000 / api / v1 /...).

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/...).

websockets有问题吗? (ws://12.12.12.12:8080 / api / ....)。

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

推荐答案

这很难说在不了解您的应用程序的情况下确定无疑。具体来说:

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


  • 您是否直接使用IP地址?

  • 您是否允许用户直接输入IP地址?除了在URL中以某种形式?

  • 您是否使用Apple基于NSURL的API以外的API直接建立网络连接?

  • 您是否明确自己出于任何原因进行DNS查找?

  • 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?

如果这四个问题的答案都是否,那么你就不会需要进行任何更改以支持IPv6。

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

直接使用IP地址时,如果用户需要输入这些地址,您可能需要添加代码允许用户也输入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.

如果您的代码自己执行DNS解析,然后使用IP地址执行某些操作,必须更新它以处理IP地址并将它们正确地传递给您使用IP地址调用的任何API。

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.

硬编码IP地址esses是一个问题。您需要为这些IP地址创建主机名。这样,设备的DNS解析器可以做各种魔术来创建虚假的IPv6地址,从而通过路由器在某处将网络地址转换为真实的IPv4地址。

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.

目前为止据我所知,AFNetworking 3.0及更高版本应该没问题,最近版本的AlamoFire也应如此。确保你是最新的。

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.

这篇关于如何测试iOS应用程序是否支持IPv6?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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