4 ms·
A gentle reminder: test your website a bit before advertising it in public. Basic aspects are broken or don't behave the way one would expect. You mention IPv6
by jiggawatts 2y ago
A gentle reminder: test your website a bit before advertising it in public. Basic aspects are broken or don't behave the way one would expect.
You mention IPv6, but it shows my IPv4 address in the website. I have a "proper" IPv6 address and other similar services can discover it, including a simple Google search: https://www.google.com/search?q=what+is+my+ip https://www.google.com/search?q=what+is+my+ip
Discovering IPv6 robustly requires an embedded iframe or a separate API service that is advertised only with AAAA records. It can't be done in a single request or with a single DNS record. Conversely, the IPv4 endpoint must use A records only.
(Hilariously the IPv4 info API request goes via IPv6!)
The advertised "curl ip.network/more" doesn't work. It might actually work with "curl" very specifically, but with any other client such as PowerShell it returns HTML instead of a JSON response:
C:\> (Invoke-RestMethod https://ip.network/more ).OuterXml
<html><head><meta charSet="utf-8" /><meta name="viewport"
content="width=device-width" /><title>What's My Public IP
Address | ip.network</title><meta name="description"
content="Check my public IP address and lookup any ip4 &
ipv6 address detail on ip.network" /><script defer="" data-
Some working alternatives for anyone interested in similar what-is-my-address APIs that work correctly with JSON and IPv6:
Invoke-RestMethod 'https://api.ipify.org?format=json'
Invoke-RestMethod 'https://api64.ipify.org?format=json'
Invoke-RestMethod 'https://api4.my-ip.io/v2/ip.json'
Invoke-RestMethod 'https://api6.my-ip.io/v2/ip.json'
Invoke-RestMethod 'http://ip-api.com/json/'
- winternewt 2y agoI don't personally disagree with the sentiment, but the prevailing message we are constantly getting on places like HN is that you should "release early", "move fast and break things" etc. So by that standard they're doing the right thing. And hey, they got you to test it for them and even describe how it needs to be fixed.
- jiggawatts 2y agoHalf way through writing that I was thinking to myself: Why am I doing unpaid QA work?
- lxgr 2y agoBecause you chose to do unpaid QA work for a free, publicly accessible utility. Thank you :)
- jve 2y agoOh boy, this works: Invoke-RestMethod https://ip.network/more https://ip.network/more -UserAgent "curl/" It would of course be better if it honored ContentType header.
- jiggawatts 2y agoI know it's cynical to say this, but I'm betting the author will just add "*PowerShell*" the list of User Agents that receive JSON and consider the bug fixed.