Using the request-ip package to actually find the IP of the request.
Live example: https://ripal.klmntn.com/
Like ipify.org, there are three APIs provided:
- Plaintext at
/api/text
- JSON at
/api/json
- JSONP (with custom defined callback) at
/api/jsonp/customCallbackName
Curl:
$ curl https://ripal.klmntn.com/api/text
Wget:
$ wget -qO- https://ripal.klmntn.com/api/text