当img.crossOrigin ="Anonymous"时,Chrome MJPEG CORS"无效响应"

Pet*_*eka 9 javascript google-chrome cross-domain mjpeg

Image from origin 'http://192.168.1.67:5555' has been blocked from loading by Cross-Origin Resource Sharing policy: Invalid response. Origin 'http://127.0.0.1:8000' is therefore not allowed access.

我需要允许此MJPEG流的交叉原点,因为用户必须能够使用按钮捕获图像而没有CORS画布被污染.

我在FF和Chrome中遇到了这个问题(IE使用不同的视频源,因为它不支持MJPEG).

我的服务器也在返回Access-Control-Allow-Origin: *页面时返回.src设置后,图像将在Javascript中设置(如果可能相关)img.crossOrigin = "Anonymous";.如果我删除crossOrigin="Anonymous",流加载但我得到污染的画布错误.

谢谢编辑:来自wireshark,MJPEG请求:

GET /2d HTTP/1.1 Host: 192.168.1.67:5555 Connection: keep-alive Accept: image/webp,image/*,*/*;q=0.8 Origin: http://127.0.0.1:8000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36 Referer: http://127.0.0.1:8000/ Accept-Encoding: gzip, deflate, sdch Accept-Language: en-US,en;q=0.8,it;q=0.6,pt;q=0.4

HTTP/1.0 200 OK Access-Control-Allow-Origin: * Access-Control-Allow-Methods: GET Access-Control-Allow-Headers: Content-Type Content-Type: multipart/x-mixed-replace; boundary=--myboundary

Zai*_*shi 1

使用此命令运行 chromechrome.exe --disable-web-security应该可以解决跨域问题

我有一个 chrome 快捷方式,这是它的目标:

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security