class ScalewayDDNS::IP

Overview

The IP class provides methods to retrieve the current external IP address using an API.

Defined in:

scaleway_ddns/ip.cr

Constant Summary

IP_API_HOST = "api.ipify.org"

The host of the IP API used to fetch the current IP address.

Class Method Summary

Class Method Detail

def self.current_ip : String #

Return current IP address from external API as string.

ScalewayDDNS::IP.current_ip # => "127.0.0.1"

# External API give an invalid response
ScalewayDDNS::IP.current_ip # => IPError: IP API: Invalid IP from external.api.com