我正在使用需要机器外部IP的API.我已经明白,如果不依赖外部服务器,我就无法做到这一点.
我过去使用过whatismyip.com:
wget -q -O - http://whatismyip.com/automation/n09230945.asp
有哪些其他服务可用于检查机器的外部IP?由于我担心单点故障,我想提供一些可以将故障转移的选项.
curl -s http://checkip.dyndns.org | sed 's/[a-zA-Z/<> :]//g'
Run Code Online (Sandbox Code Playgroud)
现在,我自己并没有写这些,只是为你做一些研究.
要么
wget -O -q icanhazip.com
Run Code Online (Sandbox Code Playgroud)