【发布时间】:2017-06-07 21:41:08
【问题描述】:
我尝试在 eclipe 中创建 httpprovider,但在 wowza 媒体服务器中运行时,它无法正确加载,它只返回 wowza 服务器版本。 eclipse的代码在这里
package com.domain.appname;
import java.io.IOException;
import java.io.OutputStream;
import com.wowza.wms.vhost.IVHost;
import com.wowza.wms.http.HTTProvider2Base;
import com.wowza.wms.http.IHTTPRequest;
import com.wowza.wms.http.IHTTPResponse;
public class CreateApp extends HTTProvider2Base {
public void onHTTPRequest(IVHost inVhost, IHTTPRequest req, IHTTPResponse resp){
String ret = req.getQueryString();
resp.setHeader("Content-Type", "text/xml");
OutputStream out = resp.getOutputStream();
byte[] outBytes = ret.toString().getBytes();
try {
out.write(outBytes);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
并将 vhost 文件设置为
<HTTPProvider>
<BaseClass>com.domain.appname.CreateApp</BaseClass>
<RequestFilters>CreateProducerApp*</RequestFilters>
<AuthenticationMethod>none</AuthenticationMethod>
</HTTPProvider>
请帮忙
【问题讨论】:
标签: wowza