简体   繁体   中英

Arbitrary host / IP lookups on Google App Engine

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, ie 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?

似乎无法直接从App Engine atm进行DNS查找:请参阅(并加注!)以下功能请求

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM