Live data from Hacker News

Your IP. In JSON

jsonip.com

11–20 of 72 posts

Re: Your IP. In JSON

#12

i see a dancing turtle at kame, but my ipv6 address is not present in the json.

Well, yes - jsonip.com has no AAAA records. I'm not sure that reporting (only! - it only knows where the connection is from) an IPv6 address is all that useful, either. That said, there's space for a jsonip6.com...

"I'm not sure that reporting [only] an IPv6 address is all that useful"

Why not? It's useful to me, and anyone else who has an IPv6 address. The future is now. Get with the program.

Re: Your IP. In JSON

#13
post #3
post #2

add a jsonp callback option like http://jsonip.com/?callback=alert

its there already: http://jsonip.com/nameofcallbackfunction

You should probably include the ?callback= functionality anyway. A great deal of libraries assume it will be a get variable, and cater for it specially

i.e. jQuery with http://jsonip.com/?callback=?

Re: Your IP. In JSON

#14
post #7

Is there an HTTPS service planned? Without it, you may just be seeing the IP of a transparent proxy server.

HTTPS can be proxied, too, transparent or not, and you'll end up with the proxy's IP. (as the HTTP headers are encrypted along with everything else, the proxy can't even include an 'X-Forwarded-For:' header) Still useful for maintaining the full 'lock' icon when embedding in other websites, though including jsonp in an https site somewhat defeats the purpose. You'd need CORS on the server for it to be useful.

Re: Your IP. In JSON

#16
Whoa. I wrote jsonip a few months ago and never expected it to get noticed. What a pleasant surprise!

Here's the original post with some usage details. http://news.ycombinator.net/item?id=1896015

This is actually running on node.js. If anyone finds a bug or has some suggestions, email me or leave a tweet @geuis.

Re: Your IP. In JSON

#20
Some suggestions:

Make jsonip.com dual stack IPv4/IPv6 and work for IPv6 addresses too. Return some other useful IP information, such as the PTR, the domain name part of the PTR, and the country code and name.

Example: https://grepular.com/ipinfo

EDIT: Don't use that URL for your own stuff or I'll block it. I only put it there as an example of how the JSON should be returned.

EDIT2: Might be useful if it included the IP addresses from any X-Forwarded-For HTTP header too.

Post reply on HN