myip
Version, currently 0.6.023 versions
- 0.6.0latestSep 18, 2026
- 0.5.2Aug 14, 2025
- 0.5.1not indexedNov 21, 2025
- 0.5.0not indexedNov 21, 2025
- 0.4.9not indexedNov 21, 2025
- 0.4.8not indexedNov 21, 2025
- 0.4.7not indexedNov 21, 2025
- 0.4.6not indexedNov 21, 2025
- 0.4.5not indexedNov 21, 2025
- 0.4.4not indexedNov 21, 2025
- 0.4.3not indexedNov 21, 2025
- 0.4.2not indexedNov 21, 2025
- 0.4.1not indexedNov 21, 2025
- 0.4.0not indexedNov 21, 2025
- 0.3.0not indexedNov 21, 2025
- 0.2.1not indexedNov 21, 2025
- 0.2.0not indexedNov 21, 2025
- 0.1.3not indexedNov 21, 2025
- 0.1.2not indexedNov 21, 2025
- 0.1.1not indexedNov 21, 2025
- 0.1.0not indexedNov 21, 2025
- test2not indexedNov 21, 2025
- test1not indexedNov 21, 2025
github.com/crystal-china/myip
返回你的公网 IP 及访问外网的公网 IP
1 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
myip:
github: crystal-china/myip
version: ~> 0.6.0Then run:
shards installshard.yml
- Crystal
1.8.0- License
- MIT
- Author
- Billy.Zheng
- Target
myipfrom src/cli.cr
Dependencies
Runtime Dependencies
- lexbor*github: kostya/lexbor
- term-spinner*github: zw963/spinner
Development Dependencies
- ameba*github: crystal-ameba/amebadev
README
myip
返回本机的公网 IP 以及访问外网的公网 IP,匿名使用以下服务(均无需 API key):
myip ipify:通过https://api.ipify.org获取 IPv4 地址myip ipify6:通过https://api6.ipify.org获取 IPv6 地址myip cf:通过 Cloudflare trace 获取 IP、机房、国家及连接信息myip ident:通过 ident.me 获取 IP 及地理信息(JSON)myip aws:通过 AWS CheckIP 获取 IP 地址myip akamai:通过 Akamai 获取 IP 地址myip ipsb:通过https://api.ip.sb/geoip获取详细 IP 信息myip ifconfig.io:通过https://ifconfig.io/ip获取 IP 地址myip ifconfig.co:通过https://ifconfig.co/json获取 IP、地理位置及 ASN 信息myip ifconfig.me:通过https://ifconfig.me/all.json获取 IP 及连接信息(JSON)myip icanhazip:通过https://icanhazip.com获取 IP 地址myip httpbin:通过https://httpbin.org/ip获取来源 IP 地址(JSON)myip dyndns:通过http://checkip.dyndns.org获取 IP 地址(HTML)myip ip111:通过https://ip111.cn获取国内、国外及 Google 路径的 IP 信息myip ip138:通过https://www.ip138.com获取国内 IP 信息
IPv6-only 服务需要当前网络具备可用的 IPv6 出口,否则会返回连接错误。
调试
默认情况下,查询失败只会向 STDERR 输出简洁错误。通过 LOG_LEVEL=DEBUG 可以同时查看原始异常和完整堆栈:
LOG_LEVEL=DEBUG myip ipify
查询结果仍输出到 STDOUT,spinner、错误和 debug 日志输出到 STDERR。

Contributing
- Fork it (https://github.com/crystal-china/myip/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Billy.Zheng - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.6.0- Tagged
- Sep 18, 2026
- Commit
7ccfbf4a4669- Crystal
1.8.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/crystal-china/myip
Metadata
- Created
- Aug 12, 2026
- Updated
- Nov 6, 2026
- Synced
- Nov 6, 2026
- Versions
- 23