
Three Ways of fetching client IP address for a WebRTC session in Wowza Streaming Engine
In the latest Wowza Java API, there are several different ways to pull the remote client’s IP address for a WebRTC session. I have been experimenting with these a little so thought of sharing them. Logging out all three of them side by side shows that they have the same values. RTPSession mostly abstracts everything. However to go deeper into the WebRTC session data you need to follow the WebRTCCommandRequest object instead and furthermore, IWebSocketSession will give you more precise data about the WebSocket layer itself.
- Fetching Client IP via RTPSession object
String IP = session.getIp();
- Fetching Client IP via RTPSession => WebRTCCommandRequest
String IP = session.getWebRTCSession().getCommandRequest().getRemoteIpAddress();
- Fetching Client IP via RTPSession => WebRTCCommandRequest => IWebSocketSession
String IP = getWebRTCSession().getCommandRequest().getWebSocketSession().getRemoteIpAddress();