主 题:【开源】Cloudflare WhoAmI:几十行 JS 快速查询本机 IP / Geo / ASN / TLS
发 布 者:oceanus
标签分类: 技术
时 间:2026-09-09 16:25:37
内容预览:随手写了个 Cloudflare Snippet,方便看当前请求的 IP、地理位置、ASN、Cloudflare 节点、TLS 等信息。估计有人会有类似的需求吧,故开源分享出来,欢迎starGitHub:https://github.com/xyTom/cf-whoami-snippetDemo: https://ip.gurl.eu.org/能看什么?访问:https://yourdomain.com/whoami默认直接返回 JSON,大概长这样:{ "ip": "203.0.113.42", "ip_version": 4, "city": "San Francisco", "region": "California", "region_code": "CA", "postal_code": "94105", "metro_code": "807", "country": "US", "continent": "NA", "latitude": "37.7757", "longitude": "-122.3952", "timezone": "America/Los_Angeles", "asn": 7922, "as_org": "Comcast Cable Communications, LLC", "colo": "SJC", "cf_ray": "xxxxxxxx-SJC", "tls_version": "TLSv1.3", "client_tcp_rtt": 7, "client_quic_rtt": null, "languages": "en-US,en;q=0.9", "user_agent": "Mozilla/5.0 ...", "map_link": "https://www.openstreetma
直达链接: https://www.nodeseek.com/post-920210-1
发 布 者:oceanus
标签分类: 技术
时 间:2026-09-09 16:25:37
内容预览:随手写了个 Cloudflare Snippet,方便看当前请求的 IP、地理位置、ASN、Cloudflare 节点、TLS 等信息。估计有人会有类似的需求吧,故开源分享出来,欢迎starGitHub:https://github.com/xyTom/cf-whoami-snippetDemo: https://ip.gurl.eu.org/能看什么?访问:https://yourdomain.com/whoami默认直接返回 JSON,大概长这样:{ "ip": "203.0.113.42", "ip_version": 4, "city": "San Francisco", "region": "California", "region_code": "CA", "postal_code": "94105", "metro_code": "807", "country": "US", "continent": "NA", "latitude": "37.7757", "longitude": "-122.3952", "timezone": "America/Los_Angeles", "asn": 7922, "as_org": "Comcast Cable Communications, LLC", "colo": "SJC", "cf_ray": "xxxxxxxx-SJC", "tls_version": "TLSv1.3", "client_tcp_rtt": 7, "client_quic_rtt": null, "languages": "en-US,en;q=0.9", "user_agent": "Mozilla/5.0 ...", "map_link": "https://www.openstreetma
直达链接: https://www.nodeseek.com/post-920210-1