Created
February 9, 2018 01:35
-
-
Save mcr/a0e003af6d3e400a7553543c19da8b95 to your computer and use it in GitHub Desktop.
IPv6 literals vs URI and Addrinfo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Either URI should be removing the [], or Addrinfo should be accepting it. Given that Addrinfo is just getaddrinfo(3), and it does not peel off the [], I think the fault is URI. | |
2.4.1 :007 > n = URI.parse("https://[::2]:1234/") | |
=> #<URI::HTTPS https://[::2]:1234/> | |
2.4.1 :008 > Addrinfo.udp(n.host, n.port) | |
SocketError: getaddrinfo: Name or service not known | |
2.4.1 :009 > n = URI.parse("coaps://[::2]:5684/") | |
=> #<URI::Generic coaps://[::2]:5684/> | |
2.4.1 :010 > Addrinfo.udp(n.host, n.port) | |
SocketError: getaddrinfo: Name or service not known | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment