Interface IHTTPProvider2

  • All Superinterfaces:
    IHTTPProvider
    All Known Implementing Classes:
    HTTPProvider2Base, com.wowza.wms.http.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);
                    }
                    
            }
    }
    
    • Method Detail

      • canHandle

        boolean canHandle​(String path)
      • setRequestFilters

        void setRequestFilters​(String requestFilters)
      • getRequestFilters

        String getRequestFilters()
      • init

        void init()
      • getAuthenticationMethod

        String getAuthenticationMethod()
      • setAuthenticationMethod

        void setAuthenticationMethod​(String authenticationMethod)