Commit 1c89c609 by xiongziliang

fixed #51

parent ee8edb8b
......@@ -56,8 +56,8 @@ onceToken token1([](){
}//namespace Http
} // namespace mediakit
static onceToken s_token([](){
void initEventListener(){
static onceToken s_token([](){
NoticeCenter::Instance().addListener(nullptr,Broadcast::kBroadcastHttpRequest,[](BroadcastHttpRequestArgs){
//const Parser &parser,HttpSession::HttpResponseInvoker &invoker,bool &consumed
if(strstr(parser.Url().data(),"/api/") != parser.Url().data()){
......@@ -98,7 +98,8 @@ static onceToken s_token([](){
invoker("200 OK",headerOut,contentOut);
});
});
}, nullptr);
}, nullptr);
}
int main(int argc,char *argv[]){
//设置退出信号处理函数
......@@ -111,6 +112,7 @@ int main(int argc,char *argv[]){
//加载配置文件,如果配置文件不存在就创建一个
loadIniConfig();
initEventListener();
//加载证书,证书包含公钥和私钥
SSL_Initor::Instance().loadCertificate((exeDir() + "ssl.p12").data());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论