You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
gryffyn 662366d4b8
Edited readme
4 months ago
cmd/ipinfo Entirely refactored application, embedded html into binary, removed geoip features, overhauled and simplified html assets 4 months ago
http Fixed html containing old templates 4 months ago
iputil Entirely refactored application, embedded html into binary, removed geoip features, overhauled and simplified html assets 4 months ago
useragent return parsed and raw user agent 2 years ago
.gitignore Entirely refactored application, embedded html into binary, removed geoip features, overhauled and simplified html assets 4 months ago
LICENSE Entirely refactored application, embedded html into binary, removed geoip features, overhauled and simplified html assets 4 months ago
Makefile Entirely refactored application, embedded html into binary, removed geoip features, overhauled and simplified html assets 4 months ago
README.md Edited readme 4 months ago
go.mod Entirely refactored application, embedded html into binary, removed geoip features, overhauled and simplified html assets 4 months ago
go.sum Entirely refactored application, embedded html into binary, removed geoip features, overhauled and simplified html assets 4 months ago

README.md

ipinfo

Simplified fork of echoip.

A simple service for looking up your IP address.

Usage

Just the business, please:

$ curl example.tld
127.0.0.1

$ http example.tld
127.0.0.1

$ wget -qO- example.tld
127.0.0.1

$ fetch -qo- https://example.tld
127.0.0.1

$ bat -print=b example.tld/ip
127.0.0.1

As JSON:

$ curl -H 'Accept: application/json' example.tld  # or curl example.tld/json
{
  "ip": "127.0.0.1",
  "ip_decimal": 2130706433,
}

Port testing:

$ curl example.tld/port/80
{
  "ip": "127.0.0.1",
  "port": 80,
  "reachable": false
}

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

Features

  • Fast
  • Supports IPv6
  • Supports HTTPS
  • Supports common command-line clients (e.g. curl, httpie, ht, wget and fetch)
  • JSON output
  • Port testing
  • All endpoints (except /port) can return information about a custom IP address specified via ?ip= query parameter
  • Open source under the BSD 3-Clause license

Building

You will no doubt want to customize the html, so the best way to build this is to clone the repo, edit the html, and build the binary.

git clone https://github.com/gryffyn/ipinfo

Edit the files in http/html, then run make install, or cd cmd/ipinfo && go build.

Usage

$ echoip -h
Usage of echoip:
  -C int
    	Size of response cache. Set to 0 to disable
  -H value
    	Header to trust for remote IP, if present (e.g. X-Real-IP)
  -l string
    	Listening address (default ":8080")
  -p	Enable port lookup
  -r	Perform reverse hostname lookups