Lightweight IP address detector which also provides some optional request metadata. https://ip.skobk.in
  • Go 69.9%
  • Go Template 29.3%
  • Dockerfile 0.8%
Find a file
Alexey Skobkin 150e8ee5fe
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/tag/ci Pipeline was successful
chore(deps): Updating Go toolchain and base images.
Go 1.25 → 1.27, golangci-lint v2.8 → v2.15, Alpine 3.20 → 3.24,
matching the latest stable releases (go1.27.2, v2.15.0, 3.24.2).
Build, vet, tests, and lint pass on the new toolchain.

Co-Authored-By: GLM-5.3 Flash <noreply@z.ai>
2026-10-17 00:05:35 +04:00
.woodpecker chore(deps): Updating Go toolchain and base images. 2026-10-17 00:05:35 +04:00
cmd/ip-detect Go rewrite (#1) 2025-12-25 22:59:28 +00:00
docs docs(readme): Adding hosted demo screenshot. 2026-10-16 23:49:50 +04:00
internal fix(web): Making Proxy and TLS sections collapsible. 2026-01-15 03:07:31 +03:00
.dockerignore Go rewrite (#1) 2025-12-25 22:59:28 +00:00
.gitignore Go rewrite (#1) 2025-12-25 22:59:28 +00:00
.golangci.yml chore(deps): Updating Go toolchain and base images. 2026-10-17 00:05:35 +04:00
Dockerfile chore(deps): Updating Go toolchain and base images. 2026-10-17 00:05:35 +04:00
go.mod chore(deps): Updating Go toolchain and base images. 2026-10-17 00:05:35 +04:00
go.sum Go rewrite (#1) 2025-12-25 22:59:28 +00:00
README.md chore(deps): Updating Go toolchain and base images. 2026-10-17 00:05:35 +04:00

Minimalistic IP detector

Build Status

A tiny Go service that returns your remote address metadata in HTML, JSON, or plain text. It mirrors the old PHP utility while adding reverse DNS lookups, request logging, and a refreshed UI.

Web UI screenshot

Requirements

  • Go 1.27 or newer

Run locally

# Serve on the default :8080
go run ./cmd/ip-detect

# Override settings with environment variables
IPD_ADDR=":9090" \
IPD_TRUSTED_SUBNETS="10.0.0.0/8,192.168.0.0/16" \
    go run ./cmd/ip-detect

Configuration

All knobs are exposed via environment variables prefixed with IPD_. Common options:

Variable Default Purpose
ADDR :8080 Bind address/port.
READ_TIMEOUT / WRITE_TIMEOUT 5s HTTP read/write limits.
READ_HEADER_TIMEOUT 5s Timeout for reading request headers.
IDLE_TIMEOUT 30s Keep-alive idle timeout.
MAX_HEADER_BYTES 1048576 Maximum request header size in bytes.
SHUTDOWN_TIMEOUT 10s Graceful shutdown timeout.
TRUST_FORWARDED false Whether to honor X-Forwarded-For / X-Real-IP.
TRUSTED_SUBNETS `` Comma-separated CIDRs required to trust proxy headers (empty = trust every proxy when TRUST_FORWARDED is true).
RESOLVE_PTR true Resolve PTR records for the detected IP.
RESOLVE_TIMEOUT 500ms Reverse DNS lookup timeout per request.
INCLUDE_UA true Attach the User-Agent header to responses.
INCLUDE_TS true Emit the current UTC timestamp.
INCLUDE_CONNECTION true Include protocol/host/remote address connection data in responses (and HTML).
INCLUDE_TLS true Include TLS session details in responses (and HTML).
INCLUDE_PREFERENCES true Include client preference headers in responses (and HTML).
INCLUDE_ORIGIN true Include origin context headers in responses (and HTML).
INCLUDE_CLIENT_HINTS true Include User-Agent Client Hints in responses (and HTML).
INCLUDE_PROXY false Include proxy-related headers in responses (and HTML) when enabled.
INCLUDE_HEADERS false Include full request headers in responses (and HTML) when enabled.
LOG_LEVEL info One of debug, info, warn, error.
LOG_FORMAT text text or json output.

Docker

Image

An Alpine-based multi-stage build is provided:

docker build -t skobkin/ip-detect .
docker run --rm -p 8080:8080 skobkin/ip-detect

Compose stack

You can find example stack here.