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

on_publish 3xx redirect using HLS doesn't change the name of the segments or directory name BUG #777

Open
headbutt opened this issue Mar 13, 2016 · 5 comments

Comments

@headbutt
Copy link

If you run a Livestream type site and allow users to stream by giving them a pubkey to stream you need a mechanism to protect the pubkey during playback or else anybody will be able to stream.

Example:

STREAMING USER: streams with below

rtmp://example.com/live pubkey: 382hki8

file names become 382hki8-(n).ts under /tmp/hls

but.. if I return a different stream name 98ke8i it still doesn't change the name of the file names

@headbutt headbutt changed the title how do you change the stream name after on_publish call using hls on_publish 3xx redirect using HLS doesn't change the name of the segments or directory name BUG Mar 13, 2016
@misiek08
Copy link
Contributor

You can try passing token as query paramter, so user will stream to

example.com/live/user?token=382hki8

and fragments generated should be named user-(n).ts. on_publish will get that query parameter, so you can still authorize users.

@benwilber
Copy link

You need to redirect to a different stream name in your on_publish endpoint.

Example:

Streamer streams to: rtmp://example.com:1935/app/<secret>

on_publish endpoint: /stream/on_publish

Should return a redirect header:

Location: foo

HLS files and RTMP play streams are now accessible under foo, not <secret>.

@headbutt
Copy link
Author

There is a bug with HLS, it doesn't create a new folder/file.ts with new redirect name. It works with rtmp, but not HLS.

@ejm
Copy link

ejm commented Aug 13, 2018

This is happening still, though @misiek08's solution worked brilliantly. I wouldn't use that in a production service, though!

@misiek08
Copy link
Contributor

@techkid6 that's the easiest and production ready solution - just rotate tokens of you have paid service.

Dynamic channel names works great too and the code to handle it is almost exactly the same.

winshining added a commit to winshining/nginx-rtmp-module that referenced this issue Apr 2, 2020
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

No branches or pull requests

4 participants