🌎 A very "simple" web server that returns your IP address in plaintext...and literally nothing else. https://simpip.com/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Jake Jarvis 75fb393b0a
deploy worker the "right" way (via wrangler)
8 months ago
.github/workflows deploy worker the "right" way (via wrangler) 8 months ago
.gitignore deploy worker the "right" way (via wrangler) 8 months ago
.npmrc deploy worker the "right" way (via wrangler) 8 months ago
Dockerfile add Dockerfile for simple testing 2 years ago
LICENSE.md Finally publishing the Cloudflare Worker version! 2 years ago
README.md security headers grade isn't really relevant 11 months ago
index.js clean up headers 11 months ago
package.json deploy worker the "right" way (via wrangler) 8 months ago
wrangler.toml deploy worker the "right" way (via wrangler) 8 months ago

README.md

🌎 simpip

Now powered purely by Cloudflare Workers, making it blazing fast from anywhere in the world — and even simpler! Try this code on the playground.

CI

A very, very "simple" and lightning-fast web server that returns the requester's IP address in plaintext...and literally nothing else. Perfect for CLI usage via curl, wget, httpie, etc. or for automated tasks like dynamic DNS updates.

The server returns your IPv6 address by default, but you can explicitly choose between IPv4 and IPv6 with curl flags:

curl simpip.com       # returns IPv6 *OR* IPv4
curl -4 simpip.com    # returns IPv4
curl -6 simpip.com    # returns IPv6, or fails to connect if network is incompatible

Usage

In my terminal's dotfiles, I have three aliases:ip4 and ip6 which are self-explanatory, and ip which returns both addresses iff your network supports IPv6; otherwise, IPv6 sliently fails and only your IPv4 address is shown.

alias ip4="curl -4 simpip.com --max-time 1 --proto-default https --silent"
alias ip6="curl -6 simpip.com --max-time 1 --proto-default https --silent"
alias ip="ip4; ip6"

Timeout is set to 1 second with --max-time 1 (otherwise we will get stuck indefinitely attempting to connect via IPv6 even if our network doesn't support it) and a secure connection preference is set with --proto-default https. Connection errors (particularly for IPv6) are silenced with --silent so that the output of ip contains nothing but IP addresses, like so:

jake@macbook:~$ ip4
1.1.1.1

jake@macbook:~$ ip6
2606:4700:4700::1111

jake@macbook:~$ ip
1.1.1.1
2606:4700:4700::1111

License

This project is distributed under the MIT license.