跳转到主内容

Ipify

非官方测试版翻译

本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →

功能

Ipify 是一个简单的公网 IP 地址 API,它会以纯文本形式返回你的公网 IP 地址。

示例配置

{
"type": "ipify",
"style": "diamond",
"foreground": "#ffffff",
"background": "#c386f1",
"leading_diamond": "",
"trailing_diamond": "",
"template": "{{ .IP }}",
"options": {
"http_timeout": 1000
}
}

选项

NameTypeDefaultDescription
urlstringhttps://api.ipify.orgThe Ipify URL, by default IPv4 is used, use https://api64.ipify.org for IPv6
http_timeoutint20in milliseconds - how long may the segment wait for a response of the ipify API
cache_durationstring24hthe duration for which the IP will be cached. The duration is a string in the format 1h2m3s and is parsed using the time.ParseDuration function from the Go standard library. To disable the cache, use none

模板 (信息)

默认模板
 {{ .IP }}

属性

NameTypeDescription
.IPstringYour external IP address