cf-ip-geo

Cloudflare Workers: 根据访问者 IP 返回地理/网络信息(数据来自 request.cfCF-Connecting-IP)。

HTTP API

API 默认允许跨域(Access-Control-Allow-Origin: *)。

提示:浏览器/系统会自动选择 IPv4/IPv6(可能优先走 IPv4)。如需强制测试 IPv6,请用 curl -6 或使用仅 AAAA 解析的域名访问。

Examples

curl https://cf-ip-geo.smyhub.com/api?pretty=1
curl -4 https://cf-ip-geo.smyhub.com/ipv4?pretty=1
curl -6 https://cf-ip-geo.smyhub.com/ipv6?pretty=1
Live: GET /api?pretty=1
Loading…