selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

ifconfig.io logo

Self-host ifconfig.io

2024.10.05

Fast IP and connection info echo service

ReleaseOpen SourceMIT
Updated2 years ago
LanguageHTML
Setup difficultyEasy
Stars
606
Ports
8080 (HTTP listener for the service), 8443 (TLS listener when TLS is enabled)
Docker
georgyo/ifconfig.io
Install with Docker Compose

What is ifconfig.io?

ifconfig.io is a small Go web service that reports connection details back to whoever asks, in the spirit of ifconfig.me but tuned for throughput — the README claims a single server handles 18,000 requests per second while using about 50 MB of RAM. A browser page shows your IP address, remote host, country code, user agent, source port, language, referer, method, encoding, MIME type and X-Forwarded-For, and plain cURL endpoints such as /ip, /host, /country_code, /ua, /port, /lang, /encoding, /mime and /forwarded return each value as text, with /all available as XML, JSON or JavaScript. It is built on the gin framework to avoid per-request memory allocations. Self-hosting is a one-service Docker Compose file using the georgyo/ifconfig.io image; environment variables let you set the displayed hostname, listen port, proxy-protocol address, the request headers used to read the client IP and country code (Cloudflare's CF-Connecting-IP and CF-IPCountry by default), and optional TLS on a separate port. The published container image has not been refreshed in years, so building from source is the way to track changes.

Should you self-host ifconfig.io?

ifconfig.io scores 48/100 on selfhost.directory (how scoring works) and ranks #15 of 20 in Network Utilities. It has 606 GitHub stars.

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is easy: most people get it running in one sitting. An official Docker image is available. It is MIT-licensed and written mostly in HTML.

Its closest alternative on selfhost.directory is MyIP (75/100, 12 241 stars). It scores higher overall, so compare the two before you pick. See ifconfig.io vs MyIP side by side.

Features

  • Country code reporting
  • JSON Output
  • Proxy-aware client IP
  • Public IP echo
  • Request header echo
  • REST API
  • Reverse DNS lookup
  • TLS Support
  • Web UI
  • XML Output

ifconfig.io README

How to install ifconfig.io

Install ifconfig.io with Docker Compose

Environment variables
HOSTNAME, CMD_PROTOCOL, HOST, PORT, PROXY_PROTOCOL_ADDR, FORWARD_IP_HEADER, COUNTRY_CODE_HEADER, TLS, TLSPORT, TLSCERT, TLSKEY
version: "3.4"

services:
  ifconfig:
    image: georgyo/ifconfig.io
    ports:
      - 8080:8080

The compose file can also pass HOSTNAME or an env_file with the documented environment variables.

How to configure ifconfig.io

  • CMD_PROTOCOL
  • COUNTRY_CODE_HEADERCF-IPCountry
  • FORWARD_IP_HEADERCF-Connecting-IP
  • HOST
  • HOSTNAMEifconfig.io
  • PORT8080
  • PROXY_PROTOCOL_ADDR
  • TLS0
  • TLSCERT/opt/ifconfig/.cf/ifconfig.io.crt
  • TLSKEY
  • TLSPORT8443

More in Network Utilities

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…