Update readme

This commit is contained in:
Martin Polden 2016-04-15 20:57:35 +02:00
parent 3988df7b6a
commit 100131e420
1 changed files with 24 additions and 25 deletions

View File

@ -1,4 +1,4 @@
# ifconfig.co: Simple IP address lookup service # ipd
[![Build Status](https://travis-ci.org/martinp/ipd.svg)](https://travis-ci.org/martinp/ipd) [![Build Status](https://travis-ci.org/martinp/ipd.svg)](https://travis-ci.org/martinp/ipd)
@ -13,34 +13,30 @@ Just the business, please:
$ curl ifconfig.co $ curl ifconfig.co
127.0.0.1 127.0.0.1
$ wget -qO - ifconfig.co $ http ifconfig.co
127.0.0.1 127.0.0.1
$ fetch -qo - ifconfig.co $ wget -qO- ifconfig.co
127.0.0.1
$ fetch -qo- http://ifconfig.co
127.0.0.1 127.0.0.1
``` ```
A specific header: Country lookup:
``` ```
$ curl ifconfig.co/user-agent $ http ifconfig.co/country
curl/7.43.0 Home, Sweet Home
$ curl ifconfig.co/x-ifconfig-country
Norway
``` ```
As JSON: As JSON:
``` ```
$ curl -H 'Accept: application/json' ifconfig.co $ http --json ifconfig.co
{ {
"x-ifconfig-ip": "127.0.0.1" "ip": "127.0.0.1",
} "country": "Home, Sweet Home"
$ curl ifconfig.co/x-config-ip.json
{
"x-ifconfig-ip": "127.0.0.1"
} }
``` ```
@ -53,9 +49,10 @@ The subdomain http://v4.ifconfig.co can be used to force IPv4 lookup.
* Easy to remember domain name * Easy to remember domain name
* Supports IPv4 and IPv6 * Supports IPv4 and IPv6
* Open source * Supports HTTPS
* Open source under the [BSD 3-Clause license](https://opensource.org/licenses/BSD-3-Clause)
* Fast * Fast
* Supports typical CLI tools (curl, wget and fetch) * Supports typical CLI tools (curl, httpie, wget and fetch)
* JSON output (optional) * JSON output (optional)
* Country lookup for IP address through the MaxMind GeoIP2 database * Country lookup for IP address through the MaxMind GeoIP2 database
@ -75,16 +72,18 @@ This application can be installed by using `go get`:
### Usage ### Usage
``` ```
ipd -h $ ipd -h
Usage: Usage:
ifconfigd [OPTIONS] ipd [OPTIONS]
Application Options: Application Options:
-f, --file=FILE Path to GeoIP database -f, --file=FILE Path to GeoIP database
-l, --listen=ADDR Listening address (:8080) -l, --listen=ADDR Listening address (default: :8080)
-x, --cors Allow requests from other domains (false) -x, --cors Allow requests from other domains
-t, --template= Path to template (index.html) -r, --reverse-lookup Perform reverse hostname lookups
-p, --port-testing Enable port testing
-t, --template= Path to template (default: index.html)
Help Options: Help Options:
-h, --help Show this help message -h, --help Show this help message
``` ```