4 ms·
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 na
by mike-cardwell 16y ago
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 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.
- geuis 16y agoThanks Mike. I'll start working some of these in over the next few days
- gmac 16y agoSome of this is already available elsewhere: I've been using http://ipinfodb.com/ http://ipinfodb.com/ to decide whether to show a region-specific alert on the front page of http://mappin.es http://mappin.es
- sghael 16y agoThis brings up something I'm waffling on. Whats the correct content type for JSON? in your example returning "Content-Type: text/plain; charset=UTF-8" which is nice because FF knows to render it in the browser (good for debugging atleast). But votes on SO seem to indicate it should be "application/json" http://stackoverflow.com/questions/477816/the-right-json-content-type http://stackoverflow.com/questions/477816/the-right-json-con...
- dugmartin 16y agoUse application/json plus the JSONView Firefox plugin to get nice pretty printed json output.
- amitraman1 16y agoapplication/json
- alanh 16y agoThe correct content-type (MIME type) is indeed "application/json" (edit: downcased JSON, not sure why I made that typo). http://tools.ietf.org/html/rfc4627 http://tools.ietf.org/html/rfc4627 Additionally, if no encoding is specified, UTF-8 should be assumed when dealing with JSON.
- IgorPartola 16y agoIPv6 is silly to support. There are no IPv6 NATs, so you should know your IPv6 address.
- jedsmith 16y agoThere are two scenarios where such a site has been useful to me: 1) Making sure I deprecated the right addresses in the Linux kernel, and that the kernel was using the outgoing address I wanted instead of the one it would pick via RFC 3484, and 2) Making sure IPv6 browsing is working since turning off v4 is a pain in the ass (in the setups I've had to troubleshoot v6 on, not my home network, where it's much easier).
- metageek 16y agoThere shouldn't be IPv6 NATs, but I expect there will be once it actually gets deployed.