Can I get the client's IP address in the call to the LCDS service?

I am trying to find the IP address of a client when it makes a specific call to the LCDS service. Understanding all the issues of getting a "real" IP address and privacy concerns, etc., can you find the client's IP address?

t

+2


source to share


3 answers


I think you can handle this easily. Not tested, but try it.



String ip = FlexContext.getHttpRequest().getRemoteAddr();

      

+1


source


I haven't found a way to do this for all channel types with a simple method call. So I am using code like this:



    String ip;
    Endpoint clientEndpoint = FlexContext.getEndpoint();
    if (clientEndpoint instanceof RTMPEndpoint) {
       ip = ((RTMPFlexSession)FlexContext.getFlexSession()).getClientInfo().getIp();  
    }
    if ((clientEndpoint instanceof NIOAMFEndpoint) || (clientEndpoint instanceof AMFEndpoint)) {
       ip = FlexContext.getHttpRequest().getRemoteAddr();
    }

      

+1


source


ip = FlexContext.getHttpRequest (). getRemoteAddr ();

gives whoz related

Thank you Roman

0


source







All Articles