Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constant CORS request issues when loading HLS stream #34

Open
ee-ee-ee opened this issue Dec 5, 2020 · 2 comments
Open

Constant CORS request issues when loading HLS stream #34

ee-ee-ee opened this issue Dec 5, 2020 · 2 comments

Comments

@ee-ee-ee
Copy link

ee-ee-ee commented Dec 5, 2020

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 :)

@ee-ee-ee
Copy link
Author

ee-ee-ee commented Dec 5, 2020

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
Copy link
Owner

Zibbp commented Dec 6, 2020

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants