2 Replies Latest reply on Sep 6, 2012 8:45 AM by Sven Plath

    How to obtain a client ip address on server side

    Sven Plath Newbie

      Hey,

       

      i ran into a new Problem. For my sample application, I need the IP address of the client that is connected. That needs to be stored in a SessionID:IP Map for referencing stuff. Now the problem is:

       

      1) I can obtain the IP Address in GWT in a RemoteServiceServlet with getThreadLocalRequest().getRemoteAddr();

      2) I can obtain the SessionID during a message callback with

           SessionContext context = SessionContext.get(message);

           context.getSession().getSessionId();

      But how can i do both the same time? I don't want to create crazy workaround involving doing both ErraiBus and GWT RPC and tying them together somehow. This seems error prone. The SessionContext does not provide a feature to get the underlying ip address, does it? It is necessary to identify the client that connects and i dont want to do it with additional parameters in the url.

       

      Thanks again!

       

      Greetings,

      Sven