MCPcopy Create free account
hub / github.com/deepch/RTSPtoWebRTC / HTTPAPIServerIndex

Function HTTPAPIServerIndex

http.go:44–56  ·  view source on GitHub ↗

HTTPAPIServerIndex index

(c *gin.Context)

Source from the content-addressed store, hash-verified

42
43//HTTPAPIServerIndex index
44func HTTPAPIServerIndex(c *gin.Context) {
45 _, all := Config.list()
46 if len(all) > 0 {
47 c.Header("Cache-Control", "no-cache, max-age=0, must-revalidate, no-store")
48 c.Header("Access-Control-Allow-Origin", "*")
49 c.Redirect(http.StatusMovedPermanently, "stream/player/"+all[0])
50 } else {
51 c.HTML(http.StatusOK, "index.tmpl", gin.H{
52 "port": Config.Server.HTTPPort,
53 "version": time.Now().String(),
54 })
55 }
56}
57
58//HTTPAPIServerStreamPlayer stream player
59func HTTPAPIServerStreamPlayer(c *gin.Context) {

Callers

nothing calls this directly

Calls 1

listMethod · 0.80

Tested by

no test coverage detected