Live data from Hacker News

Icanhazip: A simple IP address tool survived a deluge of users (2021)

blog.apnic.net

21–30 of 146 posts

Re: Icanhazip: A simple IP address tool survived a deluge of users (2021)

#21
post #4

tl;dr: Bought by Cloudflare.

> Their sponsorship of icanhazip.com has saved me tens of thousands of dollars per month. Can someone please explain how does returning a few hundred bytes of plaintext response can cost thousands of dollars? Either I'm really bad at estimating things or there's some hidden cost somewhere I'm not seeing. Also why could it not work fine behind a Cloudflare free tier?

>Also why could it not work fine behind a Cloudflare free tier?

Eh, how would that even work? You have to serve the requests anyway.

Re: Icanhazip: A simple IP address tool survived a deluge of users (2021)

#22
I made a site like this to mess with a guy at work. Everyone knew of IPChicken, and his last name is Herring, so I created IPHerring. I'd put Photoshopped images of him on the site for different holidays and coworkers always thought it was hilarious. They would even send me ideas of what to put next.

Now I sometimes use AI image generation tools to really make it stand out. It's been a lot of fun. A lot of the tech folks in my area are using it now.

Re: Icanhazip: A simple IP address tool survived a deluge of users (2021)

#23

Not related to the story of scaling the tech but rather to the IP business in 2023: I’m not affiliated with any of these services, but my goto has been ip4.me, ip6.me, and ip6only.me because they’re short and memorable and because they acknowledge the IPv4/IPv6 split. The first two domains give you your v4 and v6 IP respectively and the latter only resolves over IPv6 (useful to ensure your IPv6 is off when using a VP…

Does Chrome not recognize the .me TLD? I just tried to type that ip4.me domain twice and it just sent me to search results.

Re: Icanhazip: A simple IP address tool survived a deluge of users (2021)

#24

It's funny that there are so many of these. I use curl ifconfig.me

It's a fun project if you want to learn to code, which is why I think there're so many of them around. I built and run Accio127[1][2] for the same reason.

[1] https://api.accio127.com/v1/ip/

[2] https://git.sr.ht/~jamesponddotco/accio127

Re: Icanhazip: A simple IP address tool survived a deluge of users (2021)

#27
post #15

Earlier quoted context omitted.

the issue is that these return a bunch of html so using them from the command line is not ideal. I made wgetip.com back in 2008 to solve this. icanhaz must've been pretty suboptimal back then to have issues with traffic. wgetip still gets about 3M requests per hour. All from a single $5 droplet.

ip4.me and ip6.me have /api endpoint for programmatic access

The /api endpoint seems to return me a 301 error from the command line.

Re: Icanhazip: A simple IP address tool survived a deluge of users (2021)

#28
Why not use protocols which are specifically designed to report mapped IP address like STUN? It's faster as UDP exchange is shorter than 3-way TCP handshake (or even TCP+TLS handshake).

Here is an implementation which uses parallel STUN queries to report address reliably as fast as possible: https://github.com/Snawoot/myip

Re: Icanhazip: A simple IP address tool survived a deluge of users (2021)

#29
post #15

Earlier quoted context omitted.

ip4.me and ip6.me have /api endpoint for programmatic access

The /api endpoint seems to return me a 301 error from the command line.

  curl https://ip4.me/api/
works for me

Re: Icanhazip: A simple IP address tool survived a deluge of users (2021)

#30
For ridiculously easy things like this, I think it's smarter for you to just host it yourself. This way you are not forcing other people to carry your burden.

nginx config example:

  location /ip {
    add_header Content-Type "application/json";
    return 200 '{"host":"$server_name","ip":"$remote_addr","port":"$remote_port","server_ip":"$server_addr","server_port":"$server_port
"}\n'; }

Which will return something like this in JSON format:

    {"host":"www.example.org","ip":"199.200.200.14","port":"7990","server_ip":"199.200.100.229","server_port":"443"}
This is all done 100% within NGINX, and I include a lot of stuff you probably don't want or care about. Other web servers probably have similar capabilities.
Post reply on HN