Skip to content
Simple Node.js app that shows your IP/hostname and can speak json
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
bin
lib
systemd
.gitignore
LICENSE
Procfile
README.md
package.json

README.md

Ipz

A very simple service that shows your public ip address. You can test it on heroku. Ipz can also return your ip and hostname (if applicable) in JSON format.

Install

Ipz can be installed using npm:

$ npm install ipz

Response

Using CURL:

$ curl -X GET -H "Accept: application/json" http://ipz.herokuapp.com/

will respond with:

{"ip": "your ip here"}

or:

{
    "ip": "79.167.55.15",
    "hostname": "foo"
}

Nginx

Sample configuration using nginx. It assumes that the application listens on port 8080.

server {
    listen 80;
    server_name ip.example.com;

    location / {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;
        proxy_pass http://127.0.0.1:8080;
        proxy_redirect off;
    }
}

Run using Systemd

See ipz.service in the systemd folder.

License

See LICENSE.

Authors

Tasos Latsas

Something went wrong with that request. Please try again.