IHTTPProviderHTTPProvider2Base, com.wowza.wms.http.HTTProvider2Basepublic interface IHTTPProvider2 extends IHTTPProvider
IHTTPProvider2: Extension of IHTTPProvider that adds support for multiple HTTProviders attached to a single HostPort along with authentication. Multiple HTTPProviders can be added to a HostPort definition. They are configured as follows:
<HTTPProvider>
<BaseClass>com.wowza.wms.http.HTTPServerVersion</BaseClass>
<RequestFilters>*serverversion</RequestFilters>
<AuthenticationMethod>none</AuthenticationMethod>
</HTTPProvider>
Below is an sample implementation of the HTTPServerVersion provider:
import java.io.*;
import com.wowza.wms.server.*;
import com.wowza.wms.stream.*;
import com.wowza.wms.vhost.*;
import com.wowza.wms.logging.*;
public class HTTPServerVersion extends HTTProvider2Base
{
public void onHTTPRequest(IVHost vhost, IHTTPRequest req, IHTTPResponse resp)
{
if (!doHTTPAuthentication(vhost, req, resp))
return;
String version = MediaStreamBase.p+" "+ReleaseInfo.getVersion()+" build"+ReleaseInfo.getBuildNumber();
String retStr = "<html><head><title>"+version+"</title></head><body>"+version+"</body></html>";
try
{
OutputStream out = resp.getOutputStream();
byte[] outBytes = retStr.getBytes();
out.write(outBytes);
}
catch (Exception e)
{
WMSLoggerFactory.getLogger(HTTPServerVersion.class).error("HTMLServerVersion ", e);
}
}
}
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
canHandle(String path) |
|
String |
getAuthenticationMethod() |
|
String |
getRequestFilters() |
|
void |
init() |
|
void |
setAuthenticationMethod(String authenticationMethod) |
|
void |
setRequestFilters(String requestFilters) |
addCORSHeaders, addCORSHeaders, addDateHeader, addWebSocketSession, broadcastWebSocketMessage, getWebSocketSessionCount, getWebSocketSessions, onBind, onHTTPRequest, onUnbind, removeWebSocketSession, setProperties, validatePathboolean canHandle(String path)
String getAuthenticationMethod()
String getRequestFilters()
void init()
void setAuthenticationMethod(String authenticationMethod)
void setRequestFilters(String requestFilters)