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

handle incoming stream redirection #57

Closed
iameli opened this issue Jul 26, 2022 · 0 comments · Fixed by #61
Closed

handle incoming stream redirection #57

iameli opened this issue Jul 26, 2022 · 0 comments · Fixed by #61
Assignees

Comments

@iameli
Copy link
Member

iameli commented Jul 26, 2022

We need to handle incoming requests for e.g. https://playback.livepeer.studio/hls/PLAYBACK_ID/index.m3u8 and 302 redirect them to the address of a Catalyst server that has the stream in question. Previously, we proxied all of these requests behind the scenes, but that led to some suboptimal performance characteristics, especially around segment download latencies.

The workflow will be basically:

  1. Handle GET https://playback.livepeer.studio/hls/PLAYBACK_ID/index.m3u8
  2. Turn around and ask MistUtilLoad for the best place to watch the pertinent stream, like so:
▶ curl 'http://localhost:8042/video+PLAYBACK_ID'
185.102.219.180
  1. 302 Redirect the user to that URL https://185.102.219.180/hls/PLAYBACK_ID/index.m3u8
  2. If no stream is present, 404

There will be some nuance in getting this right, I think... for example, we'll want to check for the X-Forwarded-Proto: https header and return an HTTPS url if present, that sort of thing.

@iameli TODO: Document why we're doing the flow this way

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

Successfully merging a pull request may close this issue.

2 participants