mirror of
https://github.com/owncast/owncast.git
synced 2025-11-10 22:53:11 +08:00
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
This commit is contained in:
19
controllers/admin.go
Normal file
19
controllers/admin.go
Normal file
@@ -0,0 +1,19 @@
|
||||
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")
|
||||
}
|
||||
Reference in New Issue
Block a user