class

Sparoid::PublicIP

Inherits Reference / Object

Constants

CACHE_PATH = ENV.fetch("SPAROID_CACHE_PATH", "/tmp/.sparoid_public_ip")
URLS = {"https://ipv6.icanhazip.com", "https://ipv4.icanhazip.com"}

Class methods

by_http

icanhazip.com is from Cloudflare returns stripped IP addresses as strings, one per URL in URLS

Source
ipv4
Source
ipv6
Source