{"id":13397528,"url":"https://github.com/mpolden/echoip","last_synced_at":"2025-05-14T06:11:34.101Z","repository":{"id":5563577,"uuid":"6768827","full_name":"mpolden/echoip","owner":"mpolden","description":"IP address lookup service","archived":false,"fork":false,"pushed_at":"2023-11-14T09:15:20.000Z","size":338,"stargazers_count":4119,"open_issues_count":44,"forks_count":537,"subscribers_count":85,"default_branch":"master","last_synced_at":"2025-05-04T11:02:41.611Z","etag":null,"topics":["geoip","go","ip-address-lookup","ip-location","ip-lookup"],"latest_commit_sha":null,"homepage":"https://ifconfig.co","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mpolden.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2012-11-19T22:56:08.000Z","updated_at":"2025-05-02T08:15:30.000Z","dependencies_parsed_at":"2022-07-10T22:16:09.199Z","dependency_job_id":"283110f7-c272-4f29-9cd7-e4ac7edac310","html_url":"https://github.com/mpolden/echoip","commit_stats":{"total_commits":282,"total_committers":29,"mean_commits":9.724137931034482,"dds":0.5070921985815603,"last_synced_commit":"ffa6674637a5bf906d78ae6675f9a4680a78ab7b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolden%2Fechoip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolden%2Fechoip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolden%2Fechoip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolden%2Fechoip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpolden","download_url":"https://codeload.github.com/mpolden/echoip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253474136,"owners_count":21914226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geoip","go","ip-address-lookup","ip-location","ip-lookup"],"created_at":"2024-07-30T18:01:28.824Z","updated_at":"2025-05-14T06:11:34.006Z","avatar_url":"https://github.com/mpolden.png","language":"Go","readme":"# echoip\n\n![Build Status](https://github.com/mpolden/echoip/workflows/ci/badge.svg)\n\nA simple service for looking up your IP address. This is the code that powers\nhttps://ifconfig.co.\n\n## Usage\n\nJust the business, please:\n\n```\n$ curl ifconfig.co\n127.0.0.1\n\n$ http ifconfig.co\n127.0.0.1\n\n$ wget -qO- ifconfig.co\n127.0.0.1\n\n$ fetch -qo- https://ifconfig.co\n127.0.0.1\n\n$ bat -print=b ifconfig.co/ip\n127.0.0.1\n```\n\nCountry and city lookup:\n\n```\n$ curl ifconfig.co/country\nElbonia\n\n$ curl ifconfig.co/country-iso\nEB\n\n$ curl ifconfig.co/city\nBornyasherk\n\n$ curl ifconfig.co/asn\nAS59795\n\n$ curl ifconfig.co/asn-org\nHosting4Real\n```\n\nAs JSON:\n\n```\n$ curl -H 'Accept: application/json' ifconfig.co  # or curl ifconfig.co/json\n{\n  \"city\": \"Bornyasherk\",\n  \"country\": \"Elbonia\",\n  \"country_iso\": \"EB\",\n  \"ip\": \"127.0.0.1\",\n  \"ip_decimal\": 2130706433,\n  \"asn\": \"AS59795\",\n  \"asn_org\": \"Hosting4Real\"\n}\n```\n\nPort testing:\n\n```\n$ curl ifconfig.co/port/80\n{\n  \"ip\": \"127.0.0.1\",\n  \"port\": 80,\n  \"reachable\": false\n}\n```\n\nPass the appropriate flag (usually `-4` and `-6`) to your client to switch\nbetween IPv4 and IPv6 lookup.\n\n## Features\n\n* Easy to remember domain name\n* Fast\n* Supports IPv6\n* Supports HTTPS\n* Supports common command-line clients (e.g. `curl`, `httpie`, `ht`, `wget` and `fetch`)\n* JSON output\n* ASN, country and city lookup using the MaxMind GeoIP database\n* Port testing\n* All endpoints (except `/port`) can return information about a custom IP address specified via `?ip=` query parameter\n* Open source under the [BSD 3-Clause license](https://opensource.org/licenses/BSD-3-Clause)\n\n## Why?\n\n* To scratch an itch\n* An excuse to use Go for something\n* Faster than ifconfig.me and has IPv6 support\n\n## Building\n\nCompiling requires the [Golang compiler](https://golang.org/) to be installed.\nThis package can be installed with:\n\n`go install github.com/mpolden/echoip/...@latest`\n\nFor more information on building a Go project, see the [official Go\ndocumentation](https://golang.org/doc/code.html).\n\n## Docker image\n\nA Docker image is available on [Docker\nHub](https://hub.docker.com/r/mpolden/echoip), which can be downloaded with:\n\n`docker pull mpolden/echoip`\n\n## [GeoIP](https://www.maxmind.com/en/geoip2-databases)/[GeoLite](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data?) Database (MaxMind)\nTo utilise MaxMind [GeoIP](https://www.maxmind.com/en/geoip2-databases)/[GeoLite](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data?) database to enhance the information provided to end users, you can download the relevant **binary** databases (`.mmdb` format) directly from MaxMind using the above links.\n\n**Please Note**: This has only been tested using the free, GeoLite database.\n\n### Usage\n\n```\n$ echoip -h\nUsage of echoip:\n  -C int\n    \tSize of response cache. Set to 0 to disable\n  -H value\n    \tHeader to trust for remote IP, if present (e.g. X-Real-IP)\n  -a string\n    \tPath to GeoIP ASN database\n  -c string\n    \tPath to GeoIP city database\n  -f string\n    \tPath to GeoIP country database\n  -l string\n    \tListening address (default \":8080\")\n  -p\tEnable port lookup\n  -r\tPerform reverse hostname lookups\n  -t string\n    \tPath to template directory (default \"html\")\n```\n","funding_links":[],"categories":["Go","开源类库","go","Open source library","\u003ca id=\"170048b7d8668c50681c0ab1e92c679a\"\u003e\u003c/a\u003e工具","Network","Repositories"],"sub_categories":["网络","The Internet","\u003ca id=\"375a8baa06f24de1b67398c1ac74ed24\"\u003e\u003c/a\u003e信息收集\u0026\u0026侦查\u0026\u0026Recon\u0026\u0026InfoGather","Network Troubleshooting"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpolden%2Fechoip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpolden%2Fechoip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpolden%2Fechoip/lists"}