Go to file
renovate[bot] 6648e5fa56
Update DeterminateSystems/nix-installer-action action to v9
2023-12-05 16:30:16 +00:00
.github/workflows Update DeterminateSystems/nix-installer-action action to v9 2023-12-05 16:30:16 +00:00
templates added support of curl protocol and coping the curl command 2023-04-27 21:32:20 +03:30
.dockerignore Add Dockerfile and docker-compose.yml 2020-10-05 09:55:52 -04:00
.gitignore Progress 2018-12-27 22:12:12 +00:00
.version Add nix flake files 2020-11-15 21:19:12 -05:00
Dockerfile Switch to using jsoniter 2022-01-05 12:23:33 -05:00
LICENSE Adding dummy readme and license file 2014-07-09 11:17:34 -04:00
README.md Corrected docker image to georgyo/ifconfig.io 2023-06-11 19:44:51 +05:30
default.nix Update nix 2023-11-26 17:37:39 -05:00
docker-compose.yml Add Dockerfile and docker-compose.yml 2020-10-05 09:55:52 -04:00
flake.lock Update nix 2023-11-26 17:37:39 -05:00
flake.nix Update nix 2023-11-26 17:37:39 -05:00
go.mod Update deps 2023-11-26 10:07:19 -05:00
go.sum Update deps 2023-11-26 10:07:19 -05:00
main.go added support of curl protocol and coping the curl command 2023-04-27 21:32:20 +03:30
renovate.json Update renovate.json 2022-07-07 15:46:01 -04:00
shell.nix Update nix 2023-11-26 17:37:39 -05:00
web-service.systemd Added Javascript endpoints and systemd service example 2022-01-04 17:06:08 -05:00

README.md

ifconfig.io

Build Status

Inspired by ifconfig.me, but designed for pure speed. A single server can do 18,000 requests per seconds while only consuming 50megs of ram.

Contents

Short Summery

I used the gin framework as it does several things to ensure that there are no memory allocations on each request, keeping the GC happy and preventing unnessary allocations.

Tested to handle 10,000 clients doing 90,000 requests persecond on modest hardware with an average response time of 42ms. Easily servicing over 5 million requests in a minute. (Updated June, 2022)

LoadTest

Deployment

You can use the source code directly to deploy your own server. You can also you can use Docker and Docker Compose.

Docker-Compose

Here is a sample docker-compose file:

version: "3.4"

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

Some other compose files:

version: "3.4"

services:
  ifconfig:
    image: georgyo/ifconfig.io
    ports:
      - 8080:8080
    environment:
      HOSTNAME: "ifconfig.io"
version: "3.4"

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

ENVs

This project offers you some customizability over what you show to user and ect. Here is list of all possible environment variable that you can pass to your instance, with their default values.

HOSTNAME="ifconfig.io" # Text address shown to user at header
CMD_PROTOCOL="" # Request protocol for curl commands
HOST=""
PORT="8080"
PROXY_PROTOCOL_ADDR=""
FORWARD_IP_HEADER="CF-Connecting-IP" # Request header to get IP from
COUNTRY_CODE_HEADER="CF-IPCountry" # Request header to get country code from
TLS="0"
TLSPORT="8443"
TLSCERT="/opt/ifconfig/.cf/ifconfig.io.crt"
TLSKEY="/opt/ifconfig/.cf/ifconfig.io.key"