Stream to localhost - how to get around CORS issue

About encoding, codec settings, muxers and filter usage
JK010
New Cone
New Cone
Posts: 7
Joined: 20 Oct 2017 07:05

Stream to localhost - how to get around CORS issue

Postby JK010 » 13 Nov 2017 04:00

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.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

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

Postby Jean-Baptiste Kempf » 13 Nov 2017 12:18

Just do a dns forwarding to localhost.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

JK010
New Cone
New Cone
Posts: 7
Joined: 20 Oct 2017 07:05

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

Postby JK010 » 13 Nov 2017 22:06

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?

Rémi Denis-Courmont
Developer
Developer
Posts: 15268
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

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

Postby Rémi Denis-Courmont » 14 Nov 2017 16:46

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.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 22 guests