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