This page is served from http://localhost:8082.
The MJPEG stream is at http://localhost:8080.
Because the ports differ, these are different origins — the browser enforces CORS.
Browsers allow cross-origin images in <img> tags.
The stream loads, but JavaScript cannot read the pixels.
A fetch() to the MJPEG server will be blocked by the browser
because the server does not send Access-Control-Allow-Origin.
Even though the <img> loads, drawing it on a canvas and
calling getImageData() throws a SecurityError
(tainted canvas).
Same as fetch, but using the older XMLHttpRequest API.
The MJPEG server exposes /cors/stream.mjpg which returns
Access-Control-Allow-Origin: *. Same cross-origin request,
but now the browser allows it.
This site's nginx proxies /proxy/stream.mjpg to the MJPEG server.
The browser sees it as same-origin — no CORS at all.