I’m developing a browser plugin (see Distinguish Intranet and external IP addresses in JavaScript) that (in a nutshell) generates “scores” for every page a user visits, asynchronously submitting details about the highest scores to the back-end server, which is an App Engine instance. (This all works fine.)
I want the IP for the host the user originally requested (so that I can strip out ‘intranet’ IPs) – but because it’s somewhere between fiddly and impossible to get that on the client-side in a cross-browser way, I thought I’d send the page URL along with our AJAX call to the server and do the lookup there, using the JDK’s InetAddress class,. Unfortunately this class is blocked on App Engine.
Is there an alternate HTTP library I could use to perform host -> IP lookups there, i.e. that doesn’t go through InetAddress ?
And if there is, and I can indeed bypass the JDK restriction, is this legal / ethical / a sane approach?
It doesn’t seem possible to do DNS lookup directly from App Engine atm: see (and star!) the following feature request.