Update readme

This commit is contained in:
Martin Polden 2016-04-17 11:52:37 +02:00
parent 65d9d8ccf1
commit e4bf08de8c
1 changed files with 17 additions and 11 deletions

View File

@ -3,7 +3,7 @@
[![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)
A simple service for looking up your IP address. This is the code that powers A simple service for looking up your IP address. This is the code that powers
http://ifconfig.co https://ifconfig.co
## Usage ## Usage
@ -23,11 +23,14 @@ $ fetch -qo- http://ifconfig.co
127.0.0.1 127.0.0.1
``` ```
Country lookup: Country and city lookup:
``` ```
$ http ifconfig.co/country $ http ifconfig.co/country
Home, Sweet Home Elbonia
$ http ifconfig.co/city
Bornyasherk
``` ```
As JSON: As JSON:
@ -35,15 +38,17 @@ As JSON:
``` ```
$ http --json ifconfig.co $ http --json ifconfig.co
{ {
"ip": "127.0.0.1", "city": "Bornyasherk",
"country": "Home, Sweet Home" "country": "Elbonia",
"ip": "127.0.0.1"
} }
``` ```
Pass the appropriate flag (usually -4 and -6) to your tool to switch between Pass the appropriate flag (usually `-4` and `-6`) to your tool to switch between
IPv4 and IPv6 lookup. IPv4 and IPv6 lookup.
The subdomain http://v4.ifconfig.co can be used to force IPv4 lookup. The subdomains https://v4.ifconfig.co and https://v6.ifconfig.co can be used to
force IPv4 or IPv6 lookup.
## Features ## Features
@ -52,9 +57,9 @@ The subdomain http://v4.ifconfig.co can be used to force IPv4 lookup.
* Supports HTTPS * Supports HTTPS
* Open source under the [BSD 3-Clause license](https://opensource.org/licenses/BSD-3-Clause) * Open source under the [BSD 3-Clause license](https://opensource.org/licenses/BSD-3-Clause)
* Fast * Fast
* Supports typical CLI tools (curl, httpie, 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 and city lookup through the MaxMind GeoIP database
## Why? ## Why?
@ -77,11 +82,12 @@ Usage:
ipd [OPTIONS] ipd [OPTIONS]
Application Options: Application Options:
-f, --file=FILE Path to GeoIP database -f, --country-db=FILE Path to GeoIP country database
-c, --city-db=FILE Path to GeoIP city database
-l, --listen=ADDR Listening address (default: :8080) -l, --listen=ADDR Listening address (default: :8080)
-x, --cors Allow requests from other domains -x, --cors Allow requests from other domains
-r, --reverse-lookup Perform reverse hostname lookups -r, --reverse-lookup Perform reverse hostname lookups
-p, --port-testing Enable port testing -p, --port-lookup Enable port lookup
-t, --template= Path to template (default: index.html) -t, --template= Path to template (default: index.html)
Help Options: Help Options: