0x1234


A minimalist webspace.

Your IP address

Your request headers

Your User-Agent

Current server time

HTTP protocol version

All of the above as JSON


Linkspace


This website is User-Agent-aware.

If you request / with either curl, xh, or httpie, you will get a text file instead of this HTML page. Try it: curl -L 0x1234.net.

Above links are curl-able.

I.e. curl 0x1234.net/ip returns something like 192.168.196.1. Same with /headers, /ua, etc. You can use it in your scripts. The /all endpoint in particular returns JSON, so it is easily parseable and preferrable if you want to know several of the things above from one request. Note that the values are base64-encoded to make sure a '"' somewhere in the headers doesn't break the format. Exempli gratia:

curl -s 0x1234.net/all|jq -r '.proto'|base64 -d

Just look at /all yourself to see the exact format.

IPv4/IPv6, HTTP/HTTPS.

IPv4/IPv6. I see the IP you connect from. If you want specifically your IPv6, then ask curl nicely: curl -6 0x1234.net/ip. Likewise for requesting specifically IPv4. I don't have something like 4.ifconfig.me or 6.ifconfig.me.

HTTP/HTTPS. Naturally, I suggest you use HTTPS whenever you can. "Who would want to MiTM-substitute my external IP address that I get from 0x1234.net/ip?" Dunno. Why give an opportunity? However, the above /ip, /ua, /proto, etc. endpoints also work via HTTP, simply because curl 0x1234.net/ip uses HTTP by-default (for some bizzare reason), and that is shorter to type than curl https://0x1234.net/ip or curl -L 0x1234.net/ip. I advise you use the second way, though.

How does this work?

/ip, /headers, /ua, /time, /proto, and /all are all (pun not intended) configured in Caddy, without a backend. For example, this portion of Caddyfile returns your ip address (notice the no newline):

handle /ip {
    header Content-Type text/plain
    header Cache-Control no-store
    header Access-Control-Allow-Origin *
    respond "{http.request.remote.host}"
}

Caddy runs in a docker container with docker-compose.

Log