What is my IP address?

{{ .IP }}

Multiple command line HTTP clients are supported, including curl, httpie, GNU Wget and fetch.

CLI examples:

$ curl ifconfig.co
{{ .IP }}

$ http -b ifconfig.co
{{ .IP }}

$ wget -qO- ifconfig.co
{{ .IP }}

$ fetch -qo- http://ifconfig.co
{{ .IP }}
        
{{ if .CountryLookup }}

Country lookup:

$ http ifconfig.co/country
{{ .Country }}
        
{{ end }}

JSON output:

$ http --json ifconfig.co
HTTP/1.1 200 OK
Content-Length: 61
Content-Type: application/json
Date: Fri, 15 Apr 2016 17:26:53 GMT

{ {{ if .CountryLookup }}
    "country": "{{ .Country }}",{{ end }}{{ if .ReverseLookup }}
    "hostname": "{{ .Hostname }}",{{ end }}
    "ip": "{{ .IP }}"
}            
        
{{ if .PortTesting }}

Testing port connectivity (only supports JSON output):

http --json localhost:8080/port/8080
HTTP/1.1 200 OK
Content-Length: 47
Content-Type: application/json
Date: Fri, 15 Apr 2016 18:47:20 GMT

{
    "ip": "127.0.0.1",
    "port": 8080,
    "reachable": true
}
        
{{ end }}
Fork me on GitHub