增加cors头

This commit is contained in:
langhuihui
2020-11-16 21:23:16 +08:00
parent 7e61ba71f7
commit a9cb4cd853

View File

@@ -63,6 +63,7 @@ func runPlugin() {
}
})
http.HandleFunc("/rtsp/pull", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*")
targetURL := r.URL.Query().Get("target")
streamPath := r.URL.Query().Get("streamPath")
if err := new(RTSP).PullStream(streamPath, targetURL); err == nil {