com.wowza.wms.http
Interface IHTTPProvider2
- All Superinterfaces:
- IHTTPProvider
- All Known Implementing Classes:
- HTTProvider2Base
public 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.toString());
}
}
}
canHandle
boolean canHandle(String path)
getAuthenticationMethod
String getAuthenticationMethod()
getRequestFilters
String getRequestFilters()
init
void init()
setAuthenticationMethod
void setAuthenticationMethod(String authenticationMethod)
setRequestFilters
void setRequestFilters(String requestFilters)