Three Ways of fetching client IP address for a WebRTC session in Wowza Streaming Engine

"Only a life lived for others is a life worthwhile." – Albert Einstein

client-ip-address

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.

  1. Fetching Client IP via RTPSession object String IP = session.getIp();
  2. Fetching Client IP via RTPSession => WebRTCCommandRequest String IP = session.getWebRTCSession().getCommandRequest().getRemoteIpAddress();
  3. Fetching Client IP via RTPSession => WebRTCCommandRequest => IWebSocketSession String IP = getWebRTCSession().getCommandRequest().getWebSocketSession().getRemoteIpAddress();