Hi Wowza Members,
I want to create a module doing some business logic on each http request. I have wriiten the code below but I’m not getting the desired output.
import java.io.*;
import com.wowza.wms.http.*;
import com.wowza.wms.logging.*;
import com.wowza.wms.vhost.*;
public class ExampleTest extends HTTProvider2Base {
private static final WMSLogger log = WMSLoggerFactory
.getLogger(ExampleTest.class);
public void onHTTPRequest(IVHost vhost, IHTTPRequest req, IHTTPResponse resp) {
log.info(“Some Text” + req.getPath());
log.debug(“Some other text” + req.getPath());
log.error(“Some different text” + req.getPath());
String helloStr = “Hello World!”;
String retStr = “” + helloStr
- “” + helloStr + “”;
try {
OutputStream out = resp.getOutputStream();
byte[] outBytes = retStr.getBytes();
out.write(outBytes);
} catch (Exception e) {
log.error("ExampleTest: " + e.toString());
}
}
}
I have mentioned the fully qualified name of the class in vHost.xml
com.wowza.wms.example.module.ExampleTest
*
none
After restarting the server i tried to call many http requests but I couldn’t get the desired result.
Kindly provide some assistance to achieve the same