Get client IP from IHTTPStreamerSession

When I’m print out client IP from resolvePlayAlias method the IP is null.

Any ideas how to get the correct IP from IHTTPStreamerSession? It works for RTPSession with method rtpSession.getIp().

public class TestModule extends ModuleBase implements IMediaStreamNameAliasProvider2 {

	public String resolvePlayAlias(IApplicationInstance appInstance, String name, IHTTPStreamerSession httpSession) {
		

		String ipAddressClient = httpSession.getIpAddress();
		
		getLogger().info("Client IP: " + ipAddressClient);
		return null;
	}
	(...)
}

Result:

INFO server comment - Client IP: null

If you are using smil file, resolvePlayAlias will run once for the smil, then again for each item. I think the first pass for the smil will have null IpAddress, but the items should have it

Richard

There were some updates in Patch 2:

https://www.wowza.com/downloads/WowzaMediaServer-2-2-4/WowzaMediaServer2.2.4-patch2.zip

I’m not sure about HTTPSession when the smil is passed thru.

Richard

Great, thanks for the update, glad it’s working

Richard

Hi,

I would appreciate having it working, too. Would it be possible to add it to the wish list, please?

We generate smils dynamically, on the fly. Our module calls the application server, passing query string and IP address of the original request to it. The server needs the IP address for smil content generation (security and geo ip).

Note:

The resolvePlayAlias method gets called first, and session.getIpAddress returns null at the moment. Then, onHTTPSessionCreate gets called - and IP address is already available.

Thanks,

Jiri

Wow, great, that patch solves it!

Many thanks!

Jiri