Coder Social home page Coder Social logo

xxdesmus / ifconfigd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mpolden/echoip

0.0 2.0 0.0 390 KB

IP address lookup service written in Go

Home Page: http://ifconfig.co

License: BSD 3-Clause "New" or "Revised" License

Makefile 1.58% Go 81.67% HTML 16.74%

ifconfigd's Introduction

ifconfig.co: Simple IP address lookup service

Build Status

A simple service for looking up your IP address. This is the code that powers http://ifconfig.co

Usage

Just the business, please:

$ curl ifconfig.co
127.0.0.1

$ wget -qO - ifconfig.co
127.0.0.1

$ fetch -qo - ifconfig.co
127.0.0.1

A specific header:

$ curl ifconfig.co/user-agent
curl/7.43.0

$ curl ifconfig.co/x-ifconfig-country
Norway

As JSON:

$ curl -H 'Accept: application/json' ifconfig.co
{
  "x-ifconfig-ip": "127.0.0.1"
}

$ curl ifconfig.co/x-config-ip.json
{
  "x-ifconfig-ip": "127.0.0.1"
}

Pass the appropriate flag (usually -4 and -6) to your tool to switch between IPv4 and IPv6 lookup.

The subdomain http://v4.ifconfig.co can be used to force IPv4 lookup.

Features

  • Easy to remember domain name
  • Supports IPv4 and IPv6
  • Open source
  • Fast
  • Supports typical CLI tools (curl, wget and fetch)
  • JSON output (optional)
  • Country lookup for IP address through the MaxMind GeoIP2 database

Why?

  • To scratch an itch
  • An excuse to use Go for something
  • Faster than ifconfig.me and has IPv6 support

Building

Compiling requires the Golang compiler to be installed. This application can be installed by using go get:

go get github.com/martinp/ifconfigd

Usage

ifconfigd -h
Usage:
  ifconfigd [OPTIONS]

Application Options:
  -f, --file=FILE      Path to GeoIP database
  -l, --listen=ADDR    Listening address (:8080)
  -x, --cors           Allow requests from other domains (false)
  -t, --template=      Path to template (index.html)

Help Options:
  -h, --help           Show this help message

ifconfigd's People

Contributors

mpolden avatar twouters avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.