Ejemplo n.º 1
0
func channelProxyHandler(w http.ResponseWriter, r *http.Request) {
	vars := mux.Vars(r)
	file := vars["file"]

	channel := models.GetChannelWithId(vars["channel_id"])

	url_components := strings.Split(r.URL.RequestURI(), "?")

	query := ""

	if len(url_components) > 1 {
		query = url_components[1]
	}

	w.Write(channel.GetFile(file, query))
}
Ejemplo n.º 2
0
func channelRootHandler(w http.ResponseWriter, r *http.Request) {
	vars := mux.Vars(r)
	channel := models.GetChannelWithId(vars["channel_id"])

	w.Write(channel.GetPlaylistFile())
}