Skip to content

Repository files navigation

IP.8080.LI

A simple HTTP server and CLI tool that returns the visitor's IP address in Plain Text, JSON, JSONP or XML format along with optional geographic information.

Features

  • Supports IPv4 and IPv6
  • Two modes: CLI lookup (ip.8080.li 8.8.8.8) or HTTP server (ip.8080.li serve)
  • Response includes flag, continent, country, region, city, postal code, coordinates, timezone, ASN details, and threat score
  • All-in-one binary – GeoIP database auto-updates built in (no separate updater needed)
  • Threat intelligence – checks IPs against the IPsum threat feed (persisted to disk, works offline)
  • No API key required. No ratelimit
  • 100% Free and Open Source

CLI Mode

Look up an IP address directly from your terminal:

# positional IP
ip.8080.li 8.8.8.8
ip.8080.li 8.8.8.8 --format json

# or --ip flag
ip.8080.li --ip 8.8.8.8
Flag Default Description
--ip <addr> IP address to look up (or pass as positional arg)
--format <fmt> text Output format: text, json, jsonp, xml
--callback <name> callback JSONP callback name
--db-path <dir> ~/.config/ip.8080.li GeoIP database directory path
--update Force refresh of all data before lookup
-v, --version Show version

Output examples

$ ip.8080.li 8.8.8.8
8.8.8.8

$ ip.8080.li 8.8.8.8 --format json
{"ip":"8.8.8.8","threatScore":0}

$ ip.8080.li 8.8.8.8 --format xml
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <ip>8.8.8.8</ip>
  <threatScore>0</threatScore>
</response>

$ ip.8080.li 8.8.8.8 --format jsonp --callback myFn
myFn({"ip":"8.8.8.8","threatScore":0});

Server Mode

Start the HTTP server:

ip.8080.li serve
ip.8080.li serve --host 0.0.0.0 --port 3000
Flag Default Description
--host <addr> 0.0.0.0 Bind address
--port <port> 3000 (or PORT env) Listen port
--db-path <dir> ~/.config/ip.8080.li GeoIP database directory path

API

The below APIs support programmatic access without any limits.

IP ONLY

IP + GEO

Search Other IP


Environment Variables

Variable Default Description
PORT 3000 Server listen port
DEBUG true Enable debug logging
POWERED_BY Custom X-Powered-By header
GEOIPUPDATE_DB_PATH ~/.config/ip.8080.li GeoIP database and IPsum cache directory
GEOIPUPDATE_ACCOUNT_ID MaxMind account ID (for auto-updates)
GEOIPUPDATE_LICENSE_KEY MaxMind license key (for auto-updates)
GEOIPUPDATE_EDITION_IDS Space-separated edition IDs (e.g. GeoLite2-ASN GeoLite2-City)
GEOIPUPDATE_FREQUENCY 168 Update check interval in hours

Build from source

# build for current platform
make build
./ip.8080.li -v

# build for all platforms
make build-all
# -> dist/ip.8080.li-linux-amd64
# -> dist/ip.8080.li-darwin-arm64
# -> dist/ip.8080.li-windows-amd64.exe
# ...

# or directly with go
go build -o ip.8080.li .

The version is embedded at build time from git describe. Run ip.8080.li -v to see it.


Development

git clone https://github.com/P1N2O/ip.8080.li.git
cd ip.8080.li
cp .env.example .env

# run as server
go run . serve

# or CLI lookup in one shot
go run . 8.8.8.8

Deployment (Docker)

git clone https://github.com/P1N2O/ip.8080.li.git
cd ip.8080.li
cp .env.example .env

# build and start
docker compose up -d --build

# or use the published image
docker run -p 3000:3000 ghcr.io/p1n2o/ip.8080.li:latest

Note: The GeoIP database auto-updater and IPsum threat feed run in the same process. Set GEOIPUPDATE_ACCOUNT_ID, GEOIPUPDATE_LICENSE_KEY, and GEOIPUPDATE_EDITION_IDS in your .env to enable automatic GeoIP updates. IPsum is fetched from the public GitHub feed and cached to disk.


Release builds

Tag a version to trigger the release workflow:

git tag v1.0.0
git push origin v1.0.0

This automatically:

  1. Builds binaries for all platforms (linux, darwin, windows × amd64, arm64, arm)
  2. Uploads them to the GitHub Release
  3. Builds and pushes a multiarch Docker image to ghcr.io/<org>/ip.8080.li

Credits

LICENSE

MIT License

About

A simple HTTP server and CLI tool that returns the visitor's IP address in Plain Text, JSON, JSONP or XML format along with optional geographic information.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages