If this is a website that is calling you, then obviously you can get
the info (if in a Java servlet through HttpServletRequest's
getRemoteAddr and if in a GWT RPC call through the same mechanism
available in the LocalThread (I forget the exact name) of the remote
method itself). This is very easy.

If you are connecting to a remote site from w/i GAE, then you are
using either a task queue, XMPP, or URLFetch (if not sending emails
around as a means to communicate). I suppose you are using URLFetch.
In this case, you either have the host name (if you had the IP
address, you would not be asking this question). So, I am assuming you
got the host name through some request from the user as if the user
was the one whose IP address you needed, you could have received it as
described earlier. So, you need to lookup the IP address for the
hostname ... you need to ask an external web service to resolve it for
you against, say 8.8.8.8 ...

On Dec 16, 7:53 am, "Aces.LinuX" <[email protected]> wrote:
> Hi all,
>
> I'm trying to develop a webservice to return a IP from website, but
> i'm getting an error with the "socket" library.
>
> The code that i'm testing:
>
> import socket
> print socket.getaddrinfo("www.gogle.com", None)[0][4][0]
>
> but i'm getting the foloow error:
>
> 'module' object has no attribute 'getaddrinfo'
>       args = ("'module' object has no attribute 'getaddrinfo'",)
>
> There another way to dyscover a IP from the website?
>
> []'s

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.


Reply via email to