mirror of
https://github.com/owncast/owncast.git
synced 2025-11-01 10:55:57 +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:
@ -10,6 +10,7 @@ import (
|
||||
"github.com/gabek/owncast/controllers"
|
||||
"github.com/gabek/owncast/core/chat"
|
||||
"github.com/gabek/owncast/core/rtmp"
|
||||
"github.com/gabek/owncast/router/middleware"
|
||||
)
|
||||
|
||||
//Start starts the router for the http, ws, and rtmp
|
||||
@ -43,6 +44,11 @@ func Start() error {
|
||||
http.HandleFunc("/embed/video", controllers.GetVideoEmbed)
|
||||
}
|
||||
|
||||
// Authenticated admin requests
|
||||
|
||||
// Disconnect inbound stream
|
||||
http.HandleFunc("/api/admin/disconnect", middleware.RequireAdminAuth(controllers.DisconnectInboundConnection))
|
||||
|
||||
port := config.Config.GetPublicWebServerPort()
|
||||
|
||||
log.Infof("Web server running on port: %d", port)
|
||||
|
||||
Reference in New Issue
Block a user