diff --git a/index.html b/index.html index 5be2bae..77837ed 100644 --- a/index.html +++ b/index.html @@ -11,11 +11,9 @@
@@ -46,7 +41,7 @@CLI examples:
+$ curl ifconfig.co {{ .IP }} @@ -60,20 +55,20 @@ $ wget -qO- ifconfig.co $ fetch -qo- https://ifconfig.co {{ .IP }}{{ if .IsLookupCountryEnabled }} -
Country lookup:
+$ http ifconfig.co/country {{ .Country }}{{ end }} {{ if .IsLookupCityEnabled }} -
City lookup:
+$ http ifconfig.co/city {{ .City }}{{ end }}
JSON output:
+$ http ifconfig.co/json { {{ if .IsLookupCityEnabled }} @@ -82,13 +77,16 @@ $ http ifconfig.co/json "hostname": "{{ .Hostname }}",{{ end }} "ip": "{{ .IP }}", "ip_decimal": {{ .IPDecimal }} -} - -# or set Accept header: -# http ifconfig.co Accept:application/json+} +
Setting the Accept header to application/json also works.
+Always returns the IP address including a trailing newline, regardless of user agent.
++$ http ifconfig.co/ip +{{ .IP }}{{ if .IsLookupPortEnabled }} -
Testing port connectivity:
+$ http ifconfig.co/port/8080 { @@ -102,9 +100,11 @@ $ http ifconfig.co/port/8080