$ curl 127.0.0.1:8033 18.223.108.134 $ http -b 127.0.0.1:8033 18.223.108.134 $ wget -qO- 127.0.0.1:8033 18.223.108.134 $ fetch -qo- https://127.0.0.1:8033 18.223.108.134 $ bat -print=b 127.0.0.1:8033/ip 18.223.108.134
$ http 127.0.0.1:8033/country 美国
$ http 127.0.0.1:8033/city 未知
$ http 127.0.0.1:8033/json { "city": "未知", "country": "美国", "ip": "18.223.108.134", "ip_decimal": 316632198 }
Setting the Accept header to application/json also works.
Always returns the IP address including a trailing newline, regardless of user agent.
$ http 127.0.0.1:8033/ip 18.223.108.134
$ http 127.0.0.1:8033/port/8080 { "ip": "18.223.108.134", "port": 8080, "reachable": false }