mirror of
https://github.com/Monibuca/plugin-rtsp.git
synced 2025-10-05 07:36:57 +08:00
增加cors头
This commit is contained in:
1
main.go
1
main.go
@@ -63,6 +63,7 @@ func runPlugin() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
http.HandleFunc("/rtsp/pull", func(w http.ResponseWriter, r *http.Request) {
|
http.HandleFunc("/rtsp/pull", func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
targetURL := r.URL.Query().Get("target")
|
targetURL := r.URL.Query().Get("target")
|
||||||
streamPath := r.URL.Query().Get("streamPath")
|
streamPath := r.URL.Query().Get("streamPath")
|
||||||
if err := new(RTSP).PullStream(streamPath, targetURL); err == nil {
|
if err := new(RTSP).PullStream(streamPath, targetURL); err == nil {
|
||||||
|
Reference in New Issue
Block a user