检测本机公网出口 IP,兼容国内/国际网络环境,自动选择最快节点。
直接说或写中文即可:
节点地址延迟ipip.nethttps://myip.ipip.net~157msip.sbhttps://ip.sb~680msicanhaziphttps://icanhazip.com~580ms
节点地址延迟httpbinhttps://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。