Skip to content

Instantly share code, notes, and snippets.

@orr721
Forked from Oldes/my-ip.r3
Created March 23, 2023 20:31
Show Gist options
  • Save orr721/c75069e06ceef6af6d8bb9763137d1ad to your computer and use it in GitHub Desktop.
Save orr721/c75069e06ceef6af6d8bb9763137d1ad to your computer and use it in GitHub Desktop.
Resolve external IP address
Rebol []
my-ip?: function[
"Resolves external IP address"
][
quiet: system/options/quiet
system/options/quiet: true
host-name: read dns://
local-ip: read join dns:// host-name
external-ip: read http://ifconfig.me/ip
system/options/quiet: quiet
sys/log/info 'REBOL ["Host-name: ^[[m" host-name]
sys/log/info 'REBOL ["Local-ip: ^[[m" local-ip]
sys/log/info 'REBOL ["External-ip:^[[m" external-ip]
external-ip
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment