2020-10-02 09:17:27 +03:00
|
|
|
package admin
|
2020-10-02 04:16:58 +03:00
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
2020-10-05 20:07:09 +03:00
|
|
|
"github.com/owncast/owncast/controllers"
|
|
|
|
"github.com/owncast/owncast/core"
|
2020-10-02 09:17:27 +03:00
|
|
|
|
2020-10-05 20:07:09 +03:00
|
|
|
"github.com/owncast/owncast/core/rtmp"
|
2020-10-02 04:16:58 +03:00
|
|
|
)
|
|
|
|
|
2020-11-13 02:14:59 +03:00
|
|
|
// DisconnectInboundConnection will force-disconnect an inbound stream.
|
2020-10-02 04:16:58 +03:00
|
|
|
func DisconnectInboundConnection(w http.ResponseWriter, r *http.Request) {
|
|
|
|
if !core.GetStatus().Online {
|
2020-10-02 09:17:27 +03:00
|
|
|
controllers.WriteSimpleResponse(w, false, "no inbound stream connected")
|
2020-10-02 04:16:58 +03:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
rtmp.Disconnect()
|
2020-10-02 09:17:27 +03:00
|
|
|
controllers.WriteSimpleResponse(w, true, "inbound stream disconnected")
|
2020-10-02 04:16:58 +03:00
|
|
|
}
|