Zibbp/Radium

Constant CORS request issues when loading HLS stream

Opened this issue · 2 comments

To preface this, I know my m3u8 file is working correctly. Converted myself with ffmpeg + cuda. I am running Radium, and it is allowing me to auth, as well as chat. The demo loads perfectly fine.
I have used this exact same setup earlier in the week and it worked, using the exact settings I am running below.
When I pulled this backed down on another server, I am met with the following:

I am currently running a basic http server with python, as well as adding the headers as needed, all ports are forwarded correctly :

#!/usr/bin/env python3
from http.server import HTTPServer, SimpleHTTPRequestHandler, test
import sys

class CORSRequestHandler (SimpleHTTPRequestHandler):
    def end_headers (self):
        self.send_header('Access-Control-Allow-Origin', '*')

        SimpleHTTPRequestHandler.end_headers(self)

if __name__ == '__main__':
    test(CORSRequestHandler, HTTPServer, port=int(sys.argv[1]) if len(sys.argv) > 1 else 8000)

And when navigating to the basic http server with a browser and checking the network requests, the headers show:

Content-type: text/html; charset=utf-8
Content-Length: 25353
Access-Control-Allow-Origin: *

But when I changed the HLS_URL either through env variable or by changing the stream url in the interface, I am a met with "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://HOST:27078/output.m3u8. (Reason: CORS request did not succeed)." (I have also tried lower ports as well, and port 80)

As seen above, I am 100% sure the http server is serving the right headers for CORS, but this is now not working.

Am I missing something simple, or did something change with the last push a few days ago?

Thanks :)

Wanted to post here again, it seems that even the previous version isn't working. I am unsure if I am possibly missing something here, but every HTTP server I put up with CORS headers, Radium is giving me grief. I will continue to try on my own

Zibbp commented

The latest push updated the state that is being pushed to new users which wouldn't effect CORS.

I tried your setup and was not able to replicate the CORS issue you are having.

I ran your python script python3 script.py 6898 to create the webserver and made sure to include an hls stream in the directory. I then spun up a radium instance using the default parameters:

docker run -d --name=radium-test -p 6899:3000 -e BASE_URL=http://197.100.1.236:6899 zibbp/radium:latest

Once setup, I was able to change the HLS url to the stream hosted by the python web server located at http://197.100.1.236:6898/test/output.m3u8 without CORS issues and the HLS stream playing perfectly.

What environment variables are you passing to Radium?