class IPv6

Defined in:

ipv6.cr

Constant Summary

GOOGLE_DNS = Socket::IPAddress.new("2001:4860:4860::8888", 53)

Class Method Summary

Class Method Detail

def self.global?(ip : String) : Bool #

Check if an IPv6 address is globally reachable. Based on Rust std::net::Ipv6Addr::is_global (IETF RFC 4291, RFC 6890, etc.) ameba:disable Metrics/CyclomaticComplexity


[View source]
def self.public_ipv6 : String | Nil #

Get the public IPv6 address by asking the OS which source address it would use to reach a well-known IPv6 destination. Returns nil if no global IPv6 address is available.


[View source]