Tharases
Tharases

Reputation: 11

How to restrict http access to video files?

I want to only let "right" people watch those videos. In other words, only registered users that are allowed (by other users, ie, friends) should see videos. I have a hard retriction for cpu usage in my shared environment, so I can't use things like php's readfile.

Upvotes: 1

Views: 1177

Answers (4)

max bugaenko
max bugaenko

Reputation: 159

here is the solution http://code.google.com/p/mod-auth-token/

Upvotes: 1

Benoit
Benoit

Reputation: 3598

I liked Samir Talwar way to go. But if this is too CPU intensive (I'm not really sure of this), you can go with apache and use a backend PHP script that will allow or deny access upon user cookie state.

But have you access to apache conf in your shared env ?

If so, you can look at apache urlrewriting guide, in "Extended Redirection" section.

Upvotes: 0

Samir Talwar
Samir Talwar

Reputation: 14330

Stream through PHP using readfile, as you mention. Just set a cookie with a session ID when someone logs in and check it before you start streaming the video, and don't bother if they're not authenticated.

Upvotes: 2

Tharases
Tharases

Reputation: 1

It must be http streaming any way.

Upvotes: 0

Related Questions