srs-stack icon indicating copy to clipboard operation
srs-stack copied to clipboard

on_play callback not available in Oryx

Open jurry opened this issue 1 year ago • 3 comments

I would like to secure the access to a stream by token authentication. SRS contains on_play callback, but this option is not available in Oryx. Currently, anyone with the URL can watch the stream.

Describe the solution you'd like The goal is to prevent unauthorized users from watching a stream.

Describe alternatives you've considered I'm not aware of any alternate solution. SRS or other solution instead of Oryx may solve the issue.

jurry avatar Jul 25 '24 11:07 jurry

I'm interested if it was removed on purpose, for some particular reason, or it just needs to be implemented and tested.

jurry avatar Jul 25 '24 12:07 jurry

You can implement your own api server to authorize the play streams, set the http api hook by the env: SRS_VHOST_HTTP_HOOKS_ON_PLAY. env: SRS_VHOST_HTTP_HOOKS_ON_PLAY=http://ip/on_play_api

suzp1984 avatar Jul 25 '24 14:07 suzp1984

It is exactly what I needed, thanks! I was not aware that the SRS hooks are also exposed in Oryx. I was under an assumption Oryx had limited configuration possibilities compared to the pure SRS. I haven't found it in the documentation, maybe it should be more visible, for example in this table? https://ossrs.net/lts/en-us/docs/v5/doc/getting-started-oryx#compare-to-srs

jurry avatar Jul 28 '24 21:07 jurry