IHTTPProvider, IHTTPProvider2public abstract class HTTPProvider2Base
extends com.wowza.wms.http.HTTProvider2Base
HTTPProvider2Base: public base class for implementing HTTP Providers.
package com.wowza.wms.plugin.test.http;
public class HTTPHelloWowza extends HTTPProvider2Base
{
public void onBind(IVHost vhost, HostPort hostPort)
{
super.onBind(vhost, hostPort);
// Called when the HTTP Provider is added to the VHost it is configured for.
}
public void onUnbind(IVHost vhost, HostPort hostPort)
{
// Called when the VHost is shutting down for the hostPort configured
}
public void onHTTPRequest(IVHost vhost, IHTTPRequest req, IHTTPResponse resp)
{
// If you omit this no authentication is checked regardless of the configuration
if (!doHTTPAuthentication(vhost, req, resp))
return;
String retStr = "Hello Wowza Hello Wowza";
try
{
OutputStream out = resp.getOutputStream();
byte[] outBytes = retStr.getBytes();
out.write(outBytes);
}
catch (Exception e)
{
WMSLoggerFactory.getLogger(HTTPHelloWowza.class).error("HTTPHelloWowza ", e);
}
}
}
Can be added with the following HTTPProvider XML configuration
com.wowza.wms.plugin.test.http.HTTPHelloWowza
hellowowza*
none
authenticateHandler, authenticateHTTPProviderHandler, authenticationMethod, corsHeaders, DATEFORMAT, DATEFORMAT_LOCALE, DATEFORMAT_LOCALE_COUNTRY, DATEFORMAT_LOCALE_lANGUAGE, DATEFORMAT_ZONE, DATEHEADER_ENABLE, dateHeaderFormat, dateHeaderLocale, dateHeaderLocaleString, dateHeaderZone, enableDate, fastDateFormat, filters, properties, PROPERTY_DATE_HEADER_ENABLE, PROPERTY_DATE_HEADER_FORMAT, PROPERTY_DATE_HEADER_LOCALE, PROPERTY_DATE_HEADER_ZONE, requestFilters, webSocketSessions| Constructor | Description |
|---|---|
HTTPProvider2Base() |
addCORSHeaders, addCORSHeaders, addDateHeader, addWebSocketSession, broadcastWebSocketMessage, canHandle, doHTTPAuthentication, getAuthenticationMethod, getHostPort, getPath, getRequestFilters, getWebSocketSessionCount, getWebSocketSessions, init, onBind, onUnbind, removeWebSocketSession, setAuthenticationMethod, setProperties, setRequestFilters, validatePathonHTTPRequest