We have a need to use IPv6 literals in URLSession host addresses at times. This has its roots in issues with load balancing, and which hosts share what information, and it isn't something we can work around right now.
The IPv6 literal we're using was returned in the session metrics of a previous URLSession as the remote address of that connection.
What are the formatting requirements for that, if any? I.e., if we're setting
"61:ff4a::7a81:5002" // Not the real address :-)
As the host part of a URLComponents(),
then what's sent is
61%3aff4a%3a%3a7a81%3a5002
Which is kind of what I'd expect since it's escaping it.
If we set
"[61:ff4a::7a81:5002]"
Which is what's specified in RFC-2732 then we get a host-not-found error
Is there somewhere in the documentation about how we can use an IPv6 literal as a URLSession host address?
In Supporting IPv6 DNS64/NAT64Networks the advice is "don't", but that's not one of our options...