2021-06-21 02:26:35 +02:00
|
|
|
package controllers
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/owncast/owncast/core"
|
2022-03-07 02:31:47 +01:00
|
|
|
"github.com/owncast/owncast/models"
|
2021-06-21 02:26:35 +02:00
|
|
|
)
|
|
|
|
|
2021-09-12 09:18:15 +02:00
|
|
|
// Ping is fired by a client to show they are still an active viewer.
|
2021-06-21 02:26:35 +02:00
|
|
|
func Ping(w http.ResponseWriter, r *http.Request) {
|
2022-03-07 02:31:47 +01:00
|
|
|
viewer := models.GenerateViewerFromRequest(r)
|
|
|
|
core.SetViewerActive(&viewer)
|
2022-05-24 00:12:59 +02:00
|
|
|
w.WriteHeader(http.StatusOK)
|
2021-06-21 02:26:35 +02:00
|
|
|
}
|