Can I get the client's IP address in the call to the LCDS service?
3 answers
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 to share