-
-
Save orr721/c75069e06ceef6af6d8bb9763137d1ad to your computer and use it in GitHub Desktop.
Resolve external IP address
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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