Page 1 of 1

Stream to localhost - how to get around CORS issue

Posted: 13 Nov 2017 04:00
by JK010
I have a TS stream that I am converting to an MP4 stream. I am then trying to play it within a HTML file (on Windows 10) using a JS plugin, but the plugins that I am using fail with the following CORS message:

"Failed to load http://localhost:8081/test.mp4: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access."

I have read a bit about this and it looks like there is no way to address this within VLC. Has anybody encountered this before and is there a way around it? Some people suggested setting up a proxy server but I couldn't find anything on this that made sense and that I could follow.

Thanks.

Re: Stream to localhost - how to get around CORS issue

Posted: 13 Nov 2017 12:18
by Jean-Baptiste Kempf
Just do a dns forwarding to localhost.

Re: Stream to localhost - how to get around CORS issue

Posted: 13 Nov 2017 22:06
by JK010
Thanks for the reply, but I don't understand the exact actions that I need to take. Do you mean to add an entry in my hosts file (on Windows)? Or would this be done elsewhere on Windows?

Re: Stream to localhost - how to get around CORS issue

Posted: 14 Nov 2017 16:46
by RĂ©mi Denis-Courmont
The VLC streamer cannot know the correct value. The recommendation so far is to run VLC behind a reverse proxy, and insert the correct header value there.