0
owncast/controllers/admin.go
Gabe Kangas 7b64fc7c30
Disconnect stream Admin API + HTTP Basic Auth (#204)
* Create http auth middleware

* Add support for ending the inbound stream. Closes #191

* Add a simple success response to API requests
2020-10-01 18:16:58 -07:00

20 lines
452 B
Go

package controllers
import (
"net/http"
"github.com/gabek/owncast/core"
"github.com/gabek/owncast/core/rtmp"
)
// DisconnectInboundConnection will force-disconnect an inbound stream
func DisconnectInboundConnection(w http.ResponseWriter, r *http.Request) {
if !core.GetStatus().Online {
writeSimpleResponse(w, false, "no inbound stream connected")
return
}
rtmp.Disconnect()
writeSimpleResponse(w, true, "inbound stream disconnected")
}