fix: 加上对默认端口号的判断

This commit is contained in:
dexter
2022-03-10 09:52:47 +08:00
parent f524e94cb9
commit 618e989a1b
2 changed files with 4 additions and 1 deletions

View File

@@ -17,6 +17,9 @@ func NewRTMPClient(addr string) (client *NetConnection, err error) {
plugin.Error("connect url parse", zap.Error(err))
return nil, err
}
if strings.Count(u.Host, ":") == 0 {
u.Host += ":1935"
}
conn, err := net.Dial("tcp", u.Host)
if err != nil {
plugin.Error("dial tcp", zap.String("host", u.Host), zap.Error(err))

View File

@@ -21,7 +21,7 @@ func (ns *NetStream) Begin() {
ns.SendStreamID(RTMP_USER_STREAM_BEGIN, ns.StreamID)
}
var gstreamid = uint32(64)
var gstreamid uint32
type RTMPSubscriber struct {
RTMPSender