parent
afac6ee886
commit
0fba5f70e2
@ -73,7 +73,7 @@ func HandleConn(c *rtmp.Conn, nc net.Conn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if _hasInboundRTMPConnection {
|
if _hasInboundRTMPConnection {
|
||||||
log.Errorln("stream already running; can not overtake an existing stream")
|
log.Errorln("stream already running; can not overtake an existing stream from", nc.RemoteAddr().String())
|
||||||
_ = nc.Close()
|
_ = nc.Close()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -94,14 +94,14 @@ func HandleConn(c *rtmp.Conn, nc net.Conn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !accessGranted {
|
if !accessGranted {
|
||||||
log.Errorln("invalid streaming key; rejecting incoming stream")
|
log.Errorln("invalid streaming key; rejecting incoming stream from", nc.RemoteAddr().String())
|
||||||
_ = nc.Close()
|
_ = nc.Close()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
rtmpOut, rtmpIn := io.Pipe()
|
rtmpOut, rtmpIn := io.Pipe()
|
||||||
_pipe = rtmpIn
|
_pipe = rtmpIn
|
||||||
log.Infoln("Inbound stream connected.")
|
log.Infoln("Inbound stream connected from", nc.RemoteAddr().String())
|
||||||
_setStreamAsConnected(rtmpOut)
|
_setStreamAsConnected(rtmpOut)
|
||||||
|
|
||||||
_hasInboundRTMPConnection = true
|
_hasInboundRTMPConnection = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user