增加cors

This commit is contained in:
langhuihui
2020-06-07 20:07:10 +08:00
parent 600d3a8bd8
commit c7d84fdd3d
4 changed files with 25 additions and 1 deletions

View File

@@ -38,6 +38,7 @@ func HDLHandler(w http.ResponseWriter, r *http.Request) {
}
if s := FindStream(stringPath); s != nil {
//atomic.AddInt32(&hdlId, 1)
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Transfer-Encoding", "chunked")
w.Header().Set("Content-Type", "video/x-flv")
w.Write(avformat.FLVHeader)