mirror of
https://github.com/cnotch/ipchub.git
synced 2025-09-27 03:45:54 +08:00
mini changes
This commit is contained in:
@@ -101,7 +101,7 @@ curl http://localhost:1554/api/v1/runtime
|
|||||||
"total": 0,
|
"total": 0,
|
||||||
"active": 0
|
"active": 0
|
||||||
},
|
},
|
||||||
"rtmp": {
|
"flv": {
|
||||||
"total": 0,
|
"total": 0,
|
||||||
"active": 0
|
"active": 0
|
||||||
}
|
}
|
||||||
|
@@ -103,6 +103,3 @@ pull | 拉取权限 | * |
|
|||||||
当权限设置为 /a/+/c/*
|
当权限设置为 /a/+/c/*
|
||||||
+ 路径 a/b/c, a/d/c, a/b/c/d, a/b/c/d/e 都通过授权
|
+ 路径 a/b/c, a/d/c, a/b/c/d, a/b/c/d/e 都通过授权
|
||||||
+ 路径 a/c 不通过授权
|
+ 路径 a/c 不通过授权
|
||||||
|
|
||||||
## 5 ffmpeg
|
|
||||||
将ffmpeg设置到环境变量路径中,供rtsp到rtmp的转换
|
|
@@ -187,7 +187,6 @@ func (s *Service) onGetRuntime(w http.ResponseWriter, r *http.Request, pathParam
|
|||||||
Proc stats.Proc `json:"proc"`
|
Proc stats.Proc `json:"proc"`
|
||||||
Streams sccc `json:"streams"`
|
Streams sccc `json:"streams"`
|
||||||
Rtsp stats.ConnsSample `json:"rtsp"`
|
Rtsp stats.ConnsSample `json:"rtsp"`
|
||||||
Rtmp stats.ConnsSample `json:"rtmp"`
|
|
||||||
Wsp stats.ConnsSample `json:"wsp"`
|
Wsp stats.ConnsSample `json:"wsp"`
|
||||||
Flv stats.ConnsSample `json:"flv"`
|
Flv stats.ConnsSample `json:"flv"`
|
||||||
Extra *stats.Runtime `json:"extra,omitempty"`
|
Extra *stats.Runtime `json:"extra,omitempty"`
|
||||||
|
@@ -18,7 +18,6 @@ import (
|
|||||||
|
|
||||||
"github.com/cnotch/ipchub/config"
|
"github.com/cnotch/ipchub/config"
|
||||||
"github.com/cnotch/ipchub/media"
|
"github.com/cnotch/ipchub/media"
|
||||||
"github.com/cnotch/ipchub/network"
|
|
||||||
"github.com/cnotch/ipchub/network/socket/buffered"
|
"github.com/cnotch/ipchub/network/socket/buffered"
|
||||||
"github.com/cnotch/ipchub/network/websocket"
|
"github.com/cnotch/ipchub/network/websocket"
|
||||||
"github.com/cnotch/ipchub/provider/auth"
|
"github.com/cnotch/ipchub/provider/auth"
|
||||||
@@ -26,7 +25,6 @@ import (
|
|||||||
"github.com/cnotch/ipchub/stats"
|
"github.com/cnotch/ipchub/stats"
|
||||||
"github.com/cnotch/ipchub/utils"
|
"github.com/cnotch/ipchub/utils"
|
||||||
"github.com/cnotch/xlog"
|
"github.com/cnotch/xlog"
|
||||||
"github.com/emitter-io/address"
|
|
||||||
"github.com/pixelbender/go-sdp/sdp"
|
"github.com/pixelbender/go-sdp/sdp"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -112,11 +110,11 @@ func newSession(svr *Server, conn net.Conn) *Session {
|
|||||||
session.user = auth.Get(wsc.Username())
|
session.user = auth.Get(wsc.Username())
|
||||||
}
|
}
|
||||||
|
|
||||||
ipaddr, _ := address.Parse(conn.RemoteAddr().String(), 80)
|
// ipaddr, _ := address.Parse(conn.RemoteAddr().String(), 80)
|
||||||
// 如果是本机IP,不验证;以便ffmpeg本机rtsp->rtmp
|
// // 如果是本机IP,不验证;以便ffmpeg本机rtsp->rtmp
|
||||||
if network.IsLocalhostIP(ipaddr.IP) {
|
// if network.IsLocalhostIP(ipaddr.IP) {
|
||||||
session.authMode = auth.NoneAuth
|
// session.authMode = auth.NoneAuth
|
||||||
}
|
// }
|
||||||
|
|
||||||
for i := rtpChannelMin; i < rtpChannelCount; i++ {
|
for i := rtpChannelMin; i < rtpChannelCount; i++ {
|
||||||
session.transport.Channels[i] = -1
|
session.transport.Channels[i] = -1
|
||||||
|
@@ -101,7 +101,7 @@ func (s *Service) Listen() (err error) {
|
|||||||
defer s.Close()
|
defer s.Close()
|
||||||
s.hookSignals()
|
s.hookSignals()
|
||||||
|
|
||||||
// http rtsp rtmp ws
|
// http rtsp ws
|
||||||
addr, err := address.Parse(config.Addr(), 554)
|
addr, err := address.Parse(config.Addr(), 554)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.logger.Panic(err.Error())
|
s.logger.Panic(err.Error())
|
||||||
|
Reference in New Issue
Block a user