The http requests are always successful in a WIFI network, but some times failed when use 4G network. After change the APN protocol from IPv4/IPv6 to IPv4, then everything works well.
The host in some requests might be resolved to a IPv6 address which is not processed by the 4G network due to lack of vendor resource in China. Is it possible that the http.request API can handle this issue automatically?
Hm, do you know if you get both an IPv6 and a IPv4 address from the URL you are requesting? As in, could you test it outside of Defold somehow? We need to support both formats, and our DNS lookup will pick the first valid address that is returned from the getaddrinfo function so it depends on the position in the list. We don’t test all addresses for connection (which I guess we should, but that’s a different story), so we just assumes that the first address in the list is OK.
I’m working on an ANR issue now related to DNS lookups that coincidentally might solve your problem, but it depends on if you get both IPv4 and IPv6 addresses from the same host…
I did a simple test based on the demo project.
The socket.dns.getaddrinfo(“thirdwx.qlogo.cn”) does return a table where the first valid adress is an ipv6 address.