2020-10-07 08:14:33 +02:00
|
|
|
package controllers
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/owncast/owncast/core"
|
|
|
|
)
|
|
|
|
|
2020-11-13 00:14:59 +01:00
|
|
|
// GetConnectedClients returns currently connected clients.
|
2020-10-07 08:14:33 +02:00
|
|
|
func GetConnectedClients(w http.ResponseWriter, r *http.Request) {
|
|
|
|
clients := core.GetClients()
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
|
|
json.NewEncoder(w).Encode(clients)
|
|
|
|
}
|