Joke Collection Website - Blessing messages - Does ios uiwebview support ipv6?
Does ios uiwebview support ipv6?
1. If the online APP only uses the domain name to access, does not use the IP address, and does not use the underlying socket API, there is no need to modify the code.
Direct access to IP addresses is mainly used for testing environment.
Most apps use: NSURLSession, NSURLConnection, UIWebView, WKWebView, CFNetwork. So you don't need to modify the network code, and you don't need to make any changes to AFNetworking2.x and reachability.
However, it is recommended that you upgrade AFNetworking to the latest version. After all, NSURLConnection will be eliminated sooner or later.
Write in Swift, just use Alamofire.
2. reachability can be written as an online domain name without an IP address. You can also use the reachability of AFNetworking to judge the network connection state (it is asynchronous and does not need to input domain name or IP).
The latest version of the official statement of accessibility can use systems above iOS8. After testing, all systems above iOS 7.0 can be used.
3. Systems above 3.iOS 9.0 and OS X 10. 1 1 support IP addresses to access the network in IPv6 environment. So if the tester is a system above iOS9.0, it can be accessed directly through IP. This is because NSURLSession and CFNetwork can synthesize IPv4 addresses into IPv6 addresses after iOS 9.0 (in DNS64/NAT64 network environment).
Systems below iOS 9.0 will report an error, regardless of whether to upgrade AFNetworking. Even if AFNetworking is upgraded to 3.x, it will still report an error, such as: Error Domain = NSurrror DomainCode =-1001.
Official picture:
Step 4 share SDK
Both WeChat SDK and Sina Weibo SDK have updated their versions, claiming to support IPv6.
However, because WeChat itself does not support IPv6, even if the SDK is updated to the latest version and shared with WeChat, the APP on WeChat will always show that it cannot connect to the network.
Tests show that these shared SDKs are compatible with IPv6 without updating. (It is not clear whether we must update the SDK after WeChat supports IPv6. )
Youmeng shared official website's suggestion on upgrading SDK, and personally recommended upgrading. If you really don't want to upgrade, it should be no problem.
Let's have an episode:
Last week, the 5.2 SDK released by Youmeng had a bug of email and SMS sharing crash, and raised it with them. They upgraded yesterday afternoon.
Second, existing apps support IPv6:
1, most of them support IPv6, such as QQ, Taobao and Dianping.
1. 1, because most apps use domain names instead of ip addresses.
1.2, and the underlying socket api is not called.
1.3, DNS lookup is not required.
2. Very few apps don't support IPv6, such as WeChat.
Three. DNS64/ NAT64
DNS64/ NAT64 conversion workflow:
1. Provide an independent cellular network with IPv4 and IPv6 connections, and upgrade the IPv4 network to IPv6.
The above picture is only an ideal situation to upgrade to IPv6, but now most of them are servers of IPv4, so some big manufacturers begin to implement the transition of DNS64/NAT64 to support IPv6.
2. Deploy the cellular network of DNS64/NAT64 IPv6.
When a client requests a website domain name, it will first query whether there is an IPv6 address in the domain name through the DNS64 server, and if there is, it will return the IPv6 address. If it does not exist, find the IPv4 address corresponding to the domain name and return.
The following is a detailed flow chart:
3.DNS64/NAT64 conversion process:
DNS64/NAT64 can convert IPv4 addresses to IPv6 and resolve IPv6 addresses to IPv4.
Translation from IPv4 address to IPv6:
When the client accesses the domain name of the website, if the website has only one IPv6 address: 56.111.21.22, it will be converted into 16 hexadecimal: 38 6fd3/kloc-.
Fourthly, build an IPv6 environment.
The MAC system is OS 10. 1 1 and above.
1. Go to "System Preferences"-"Hold down the option/alt key-"of the MAC computer and click "* * * Enjoy".
2. Select "Create NAT64 Network", and then open the hotspot.
3. After the mobile phone connects to the hotspot, check that the DNS of the network is: XX: XX: XX: XX, indicating that the network is IPv6.
The following figure is a schematic diagram of MAC building IPv6:
At present, a network card will use two addresses at the same time; In the future, the network card will have only one IPv6 address. The two devices can't access directly, and they need the transition technology of DNS64/NAT64 to access each other.
5. upgrade AFNetworking2. X to the latest version.
1. replace AFHTTPRequestOperationManager with AFHTTPSessionManager.
2. replace AFHTTPRequestOperation with: NSURLSessionTask.
3. If it is accessed through IP, or allow _addr ().
inet_aton()
inet_lnaof()
inet_makeaddr()
inet_netof()
Inet network ()
inet_ntoa()
inet_ntoa_r()
bindresvport()
getipv4sourcefilter()
setipv4sourcefilter()
2. If you use the following code to handle IPv4 types, please ensure that you also handle IPv6 forms:
IPv4
IPv6
AF_INET
AF_INET6
PF _ network
PF_INET6
Structure input address
Structure Input _ Address 6
Structure sockaddr_in
Structure sockaddr_in6
kDNSServiceProtocol_IPv4
kDNSServiceProtocol_IPv6
- Previous article:Shaanxi etc is in arrears, how to pay it back?
- Next article:Is Huaxi Bio a State-owned Enterprise or a Private Enterprise?
- Related articles
- What's the matter with little brother Henan ordering takeout to send homeless people?
- Does Yougou have a computer lottery? Is it true that the text message on my mobile phone said that I won the second prize in the TV shopping computer lottery?
- How to create pictures of Apple call records
- A tutorial on how to restore text after deleting short messages on Vivo mobile phones.
- What about loans overdue, the logistics truck?
- If I register as a Didi driver, will Didi Software send the information to the owner, that is, my father?
- English translation, urgent. Thank you!
- Short message template for anytime loan authentication
- How to cancel SMS receipt
- Qingming is approaching, how to do a good job in forest fire prevention?