mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-02-24 17:20:54 +08:00
update
This commit is contained in:
@@ -12,9 +12,12 @@
|
||||
#include "Rtsp/RtspSession.h"
|
||||
#include "Rtmp/RtmpSession.h"
|
||||
#include "Http/HttpSession.h"
|
||||
#include "Http/HttpsSession.h"
|
||||
|
||||
#ifdef ENABLE_OPENSSL
|
||||
#include "Util/SSLBox.h"
|
||||
#include "Util/SqlPool.h"
|
||||
#include "Http/HttpsSession.h"
|
||||
#endif//ENABLE_OPENSSL
|
||||
|
||||
#include "Util/logger.h"
|
||||
#include "Util/onceToken.h"
|
||||
#include "Util/File.h"
|
||||
@@ -50,6 +53,8 @@ int main(int argc,char *argv[]){
|
||||
player->play(url);
|
||||
proxyMap.emplace(string(url),player);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_OPENSSL
|
||||
//请把证书"test_server.pem"放置在本程序可执行程序同目录下
|
||||
try{
|
||||
SSL_Initor::Instance().loadServerPem((exePath() + ".pem").data());
|
||||
@@ -57,22 +62,32 @@ int main(int argc,char *argv[]){
|
||||
FatalL << "请把证书:" << (exeName() + ".pem") << "放置在本程序可执行程序同目录下:" << exeDir() << endl;
|
||||
return 0;
|
||||
}
|
||||
#endif //ENABLE_OPENSSL
|
||||
|
||||
TcpServer<RtspSession>::Ptr rtspSrv(new TcpServer<RtspSession>());
|
||||
TcpServer<RtmpSession>::Ptr rtmpSrv(new TcpServer<RtmpSession>());
|
||||
TcpServer<HttpSession>::Ptr httpSrv(new TcpServer<HttpSession>());
|
||||
TcpServer<HttpsSession>::Ptr httpsSrv(new TcpServer<HttpsSession>());
|
||||
|
||||
rtspSrv->start(mINI::Instance()[Config::Rtsp::kPort]);
|
||||
rtmpSrv->start(mINI::Instance()[Config::Rtmp::kPort]);
|
||||
httpSrv->start(mINI::Instance()[Config::Http::kPort]);
|
||||
|
||||
|
||||
#ifdef ENABLE_OPENSSL
|
||||
TcpServer<HttpsSession>::Ptr httpsSrv(new TcpServer<HttpsSession>());
|
||||
httpsSrv->start(mINI::Instance()[Config::Http::kSSLPort]);
|
||||
#endif //ENABLE_OPENSSL
|
||||
|
||||
|
||||
EventPoller::Instance().runLoop();
|
||||
|
||||
rtspSrv.reset();
|
||||
rtmpSrv.reset();
|
||||
httpSrv.reset();
|
||||
|
||||
#ifdef ENABLE_OPENSSL
|
||||
httpsSrv.reset();
|
||||
#endif //ENABLE_OPENSSL
|
||||
|
||||
UDPServer::Destory();
|
||||
WorkThreadPool::Destory();
|
||||
|
||||
Reference in New Issue
Block a user