Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

Addrinfo#ipv6?

() -> bool
addrinfo.ipv6? => true or false

returns true if addrinfo is IPv6 address. returns false otherwise.

Example
Addrinfo.tcp("127.0.0.1", 80).ipv6? #=> false
Addrinfo.tcp("::1", 80).ipv6?       #=> true
Addrinfo.unix("/tmp/sock").ipv6?    #=> false