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

Set custom CORS to prevent clients from connecting to streaming #209

Open
irg1008 opened this issue Oct 12, 2024 · 3 comments
Open

Set custom CORS to prevent clients from connecting to streaming #209

irg1008 opened this issue Oct 12, 2024 · 3 comments

Comments

@irg1008
Copy link

irg1008 commented Oct 12, 2024

Is there a way to set CORS to prevent clients from watching streamings from unauthorized origins after gaining viewing token?

@Thulinma
Copy link
Contributor

Good question! Currently, CORS headers are hardcoded to allow all access.
It would be pretty easy to hardcode something else, see: https://github.com/DDVTECH/mistserver/blob/master/lib/http_parser.cpp#L131-L143

We've been wanting to make this configurable, but never got around to it. It will probably happen at some point, but if you want something fast I'd recommend editing those lines of code to suit your needs and compiling it yourself.

@irg1008
Copy link
Author

irg1008 commented Oct 13, 2024

Hmm I see, how could set that to get from Env Var for the moment?

@irg1008
Copy link
Author

irg1008 commented Oct 13, 2024

Maybe an alternative way would be to send origin in NEW_USER trigger?

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

2 participants