Install
openclaw skills install get-public-ip检测公网出口 IP,支持国内和国际网络环境,自动切换最优节点,超时保护,秒级完成。
openclaw skills install get-public-ip检测本机公网出口 IP,兼容国内/国际网络环境,自动选择最快节点。
直接说或写中文即可:
| 节点 | 地址 | 延迟 |
|---|---|---|
| ipip.net | https://myip.ipip.net | ~157ms |
| ip.sb | https://ip.sb | ~680ms |
| icanhazip | https://icanhazip.com | ~580ms |
| 节点 | 地址 | 延迟 |
|---|---|---|
| httpbin | https://httpbin.org/ip | ~890ms |
成功:
当前公网IP:171.83.108.245 | 来源:ip.sb | 耗时:681ms
失败:
❌ 无法获取公网IP,请检查网络连接
当收到获取 IP 请求时,用 PowerShell 执行以下逻辑(Windows 直接调用,macOS/Linux 用 curl):
依次尝试:
https://ip.sb - 提取纯文本 IP,格式验证https://myip.ipip.net - 提取 当前 IP:xxx 中的 IPhttps://icanhazip.com - 提取纯文本 IP国内全失败时尝试:
4. https://httpbin.org/ip - 解析 JSON 中的 origin
每个节点最多 5 秒超时,任一成功立即返回。
每个节点最多 5 秒,全节点总超时 20 秒。远超即判定失败。
无外部依赖。Windows 使用内置 Invoke-WebRequest,macOS/Linux 使用 curl。