Puma uses TCPSocket.gethostbyname to receive a list of localhost addresses. So this issue is important for puma.
ruby-2.3.1 will provide:
["localhost", , 10, "::1", "127.0.0.1"]
jruby-126.96.36.199 will provide
["127.0.0.1", , 2, "127.0.0.1"]
Please make gethostbyname compatible with the recent mri ruby.
Link to current implementation: org/jruby/ext/socket/RubyTCPSocket.java
In MRI trunk:
Here was a comment that taught me a thing:
* Note that it is not guaranteed to be able to convert to IP address using gethostbyname, getaddrinfo, etc.
* If you need local IP address, use Socket.ip_address_list.
Workaround?: Trying it, I noted that Socket.ip_address_list produces Addrinfo objects. Can those be used by puma's localhost_addresses to synthesize that list?
Sure. This solution is ok. I will create an issue for puma.