
Show HN: ipv4.cat – your public IP address from any OS terminal - lukejjh
https://about.ipv4.cat/
======
helb
It doesn't work with recent (7.66.0+) curl versions without an additional
parameter, because curl somehow assumes it's a HTTP/0.9 response and these
were made opt-in:

    
    
        $ curl ipv4.cat
        curl: (1) Received HTTP/0.9 when not allowed
    
        $ curl --http0.9 ipv4.cat
        (returns my IP)
    

[https://github.com/curl/curl/commit/a42b0957ab31c971a79bfe55...](https://github.com/curl/curl/commit/a42b0957ab31c971a79bfe5542b3017fd834ac49)

------
WinonaRyder
Yesterday we had a great thread about tools for detecting captive portals;
today one about getting your IP address.

Anyway... not quite the same as this, but we have one that also supports
responding with a non-200 status if a field doesn't match e.g. `curl --fail
[https://whoami.oya.to/tor-
exit=true,ip=192.168.1.2`](https://whoami.oya.to/tor-
exit=true,ip=192.168.1.2`).

[https://whoami.oya.to/about](https://whoami.oya.to/about)

------
mihaifm
A bit off topic but weren’t .cat domains restricted to the Catalan language?
Not sure if it’s enforced though.

------
tiernano
Sounds a lot like telnetmyip.com...

------
drakmail
Sounds a lot like ifconfig.me...

~~~
lukejjh
"Sounds a lot" like it? Sure. I've already acknowledged that on the about
page. The important point of difference here is that ipv4.cat is listening for
any _TCP_ connection, not just HTTP requests. This is probably most
significant for Windows since no CLI HTTP client is included out of the box
(with the exception of some PowerShell cmdlets). Even a telnet client isn't
included by default in Windows nowadays. This is the most universal way (as
far as I can tell) to obtain a public IP address from any operating system at
a terminal - just type `ftp ipv4.cat`. That's why I think this is unique.

