Skip to content

Instantly share code, notes, and snippets.

Last active January 30, 2021 22:43
What would you like to do?
Get your External IP

To my fello Rakuoons, here is a quick script that will return your external IP. Works great with home systems or EC2 instances!

use Inline::Perl5; 
use Cro::HTTP::Client; 
use Mojo::DOM:from<Perl5>; 

my $r = await Cro::HTTP::Client.get("", :http<1.1>); 
my $d = $r.body); 

Feel free to comment, below!

Copy link


Copy link

Xliff commented Jan 30, 2021

For Perl5 users -- Note the different URL:

my $ua = LWP::UserAgent->new(verify_hostname => 0);
my $re  = $ua->get("");
print $re->decoded_content

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment