mirror of
				https://github.com/owncast/owncast.git
				synced 2025-11-04 13:27:21 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			16 lines
		
	
	
		
			350 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			350 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package controllers
 | 
						|
 | 
						|
import (
 | 
						|
	"net/http"
 | 
						|
 | 
						|
	"github.com/owncast/owncast/core"
 | 
						|
	"github.com/owncast/owncast/models"
 | 
						|
)
 | 
						|
 | 
						|
// Ping is fired by a client to show they are still an active viewer.
 | 
						|
func Ping(w http.ResponseWriter, r *http.Request) {
 | 
						|
	viewer := models.GenerateViewerFromRequest(r)
 | 
						|
	core.SetViewerActive(&viewer)
 | 
						|
	w.WriteHeader(http.StatusOK)
 | 
						|
}
 |