cors icon indicating copy to clipboard operation
cors copied to clipboard

proxying m3u8 links

Open lastraum opened this issue 4 years ago • 4 comments

Hi there, so this proxy works for static files, but i'd like to proxy in an external m3u8 link since it doesn't have the correct headers for CORS.

Is this possible with your index.js or is there a mod to returning a stream data?

lastraum avatar Apr 27 '21 07:04 lastraum

Hello, can you give me a more detailed explanation of your problem?

ryanking13 avatar Apr 27 '21 08:04 ryanking13

So following your example, proxying a static website is fine and works perfectly. But if i want to proxy an m3u8 link (https://liveproduseast.global.ssl.fastly.net/btv/desktop/us_live.m3u8), the index.js no longer works. Are there additional / separate headers to add to the response object for an m3u8 link specifically? This proxy I'm creating will strictly be used for this type of link fyi

lastraum avatar Apr 27 '21 15:04 lastraum

@lastraum

I skimmed through how m3u8 and HLS works, and I don't think it is a matter of headers.

The video player library you use to play streaming first parses the m3u8 file and sends subsequent requests to get stream files. So, you need to modify the source of the video player library in order to change every request it makes to go through the CORS proxy.

ryanking13 avatar Apr 28 '21 01:04 ryanking13

Ok interesting. I was doing some reading too and saw where people were determining if the request was .m3u8 or if it was a .ts and handling the request accordingly. Thanks!

lastraum avatar Apr 28 '21 05:04 lastraum