mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-16 21:15:57 +08:00
支持绑定到指定网卡 (#3760)
This commit is contained in:
@@ -281,6 +281,7 @@ int start_main(int argc,char *argv[]) {
|
||||
});
|
||||
}
|
||||
|
||||
std::string listen_ip = mINI::Instance()[General::kListenIP];
|
||||
uint16_t shellPort = mINI::Instance()[Shell::kPort];
|
||||
uint16_t rtspPort = mINI::Instance()[Rtsp::kPort];
|
||||
uint16_t rtspsPort = mINI::Instance()[Rtsp::kSSLPort];
|
||||
@@ -362,39 +363,39 @@ int start_main(int argc,char *argv[]) {
|
||||
|
||||
try {
|
||||
//rtsp服务器,端口默认554
|
||||
if (rtspPort) { rtspSrv->start<RtspSession>(rtspPort); }
|
||||
if (rtspPort) { rtspSrv->start<RtspSession>(rtspPort, listen_ip); }
|
||||
//rtsps服务器,端口默认322
|
||||
if (rtspsPort) { rtspSSLSrv->start<RtspSessionWithSSL>(rtspsPort); }
|
||||
if (rtspsPort) { rtspSSLSrv->start<RtspSessionWithSSL>(rtspsPort, listen_ip); }
|
||||
|
||||
//rtmp服务器,端口默认1935
|
||||
if (rtmpPort) { rtmpSrv->start<RtmpSession>(rtmpPort); }
|
||||
if (rtmpPort) { rtmpSrv->start<RtmpSession>(rtmpPort, listen_ip); }
|
||||
//rtmps服务器,端口默认19350
|
||||
if (rtmpsPort) { rtmpsSrv->start<RtmpSessionWithSSL>(rtmpsPort); }
|
||||
if (rtmpsPort) { rtmpsSrv->start<RtmpSessionWithSSL>(rtmpsPort, listen_ip); }
|
||||
|
||||
//http服务器,端口默认80
|
||||
if (httpPort) { httpSrv->start<HttpSession>(httpPort); }
|
||||
if (httpPort) { httpSrv->start<HttpSession>(httpPort, listen_ip); }
|
||||
//https服务器,端口默认443
|
||||
if (httpsPort) { httpsSrv->start<HttpsSession>(httpsPort); }
|
||||
if (httpsPort) { httpsSrv->start<HttpsSession>(httpsPort, listen_ip); }
|
||||
|
||||
//telnet远程调试服务器
|
||||
if (shellPort) { shellSrv->start<ShellSession>(shellPort); }
|
||||
if (shellPort) { shellSrv->start<ShellSession>(shellPort, listen_ip); }
|
||||
|
||||
#if defined(ENABLE_RTPPROXY)
|
||||
//创建rtp服务器
|
||||
if (rtpPort) { rtpServer->start(rtpPort); }
|
||||
if (rtpPort) { rtpServer->start(rtpPort, listen_ip.c_str()); }
|
||||
#endif//defined(ENABLE_RTPPROXY)
|
||||
|
||||
#if defined(ENABLE_WEBRTC)
|
||||
//webrtc udp服务器
|
||||
if (rtcPort) { rtcSrv_udp->start<WebRtcSession>(rtcPort);}
|
||||
if (rtcPort) { rtcSrv_udp->start<WebRtcSession>(rtcPort, listen_ip);}
|
||||
|
||||
if (rtcTcpPort) { rtcSrv_tcp->start<WebRtcSession>(rtcTcpPort);}
|
||||
if (rtcTcpPort) { rtcSrv_tcp->start<WebRtcSession>(rtcTcpPort, listen_ip);}
|
||||
|
||||
#endif//defined(ENABLE_WEBRTC)
|
||||
|
||||
#if defined(ENABLE_SRT)
|
||||
// srt udp服务器
|
||||
if (srtPort) { srtSrv->start<SRT::SrtSession>(srtPort); }
|
||||
if (srtPort) { srtSrv->start<SRT::SrtSession>(srtPort, listen_ip); }
|
||||
#endif//defined(ENABLE_SRT)
|
||||
|
||||
} catch (std::exception &ex) {
|
||||
|
||||
Reference in New Issue
Block a user