How to control access to Adobe HDS streaming (sanjosestreaming)

Example module that illustrates the basic API for controlling access to an Adobe HDS stream.

package com.wowza.wms.example.module;

import com.wowza.wms.httpstreamer.sanjosestreaming.httpstreamer.HTTPStreamerSessionSanJose;
import com.wowza.wms.module.*;
import com.wowza.wms.application.*;

public class ModuleAccessControlSanJoseStreaming extends ModuleBase
{
public void onHTTPSanJoseStreamingSessionCreate(HTTPStreamerSessionSanJose httpSanJoseStreamingSession)
{
boolean isGood = true;

	String ipAddressClient = httpSanJoseStreamingSession.getIpAddress();
	String ipAddressServer = httpSanJoseStreamingSession.getServerIp();
	String queryStr = httpSanJoseStreamingSession.getQueryStr();
	String referrer = httpSanJoseStreamingSession.getReferrer();
	String cookieStr = httpSanJoseStreamingSession.getCookieStr();
	String userAgent = httpSanJoseStreamingSession.getUserAgent();

	IApplicationInstance appInstance = httpSanJoseStreamingSession.getAppInstance();
	String streamName = httpSanJoseStreamingSession.getStreamName();

	// Here you can use the request and session information above to determine
	// if you want to reject the connection
	// isGood = true/false;
	getLogger().info("ModuleAccessControlCupertinoStreaming.onHTTPCupertinoStreamingSessionCreate["+appInstance.getContextStr()+":"+streamName+"]: accept:"+isGood);

	if (!isGood)
		httpSanJoseStreamingSession.rejectSession();
	}
}
<Module>
	<Name>ModuleAccessControlSanJoseStreaming</Name>
	<Description>ModuleAccessControlSanJoseStreaming</Description>
	<Class>com.wowza.wms.example.module.ModuleAccessControlSanJoseStreaming</Class>
</Module>

Originally Published: 03-04-2011.

If you're having problems or want to discuss this article, post in our forum.