This technology allows to protect streams from illegal viewing with the help of temporary tokens
Go to the tab
Settings -> HTTP Authenticationand set the checkbox in the field
Enable built-in HTTP/HLS authentication (restart required). After this action - in the SECURETOKEN come up with our secret key. For example - the word
testSave the settings and restart Astra.
- Go to the console of our server and download the example token generator: securetoken.php
cd /tmp wget http://cesbo.com/download/astra/scripts/auth/http-backend/securetoken.php
Edit the file: in the variable $key = 'SECRETKEY' we will write our secret word - 'test' Save the changes and run token-generator: (Note: PHP must be installed on the server!)
php -S 0:81 /tmp/securetoken.php
- Lets go to the settings of any of our stream. We need his ID:
In the example it is a stream with id
a01and hls-output at
http://0:8002/test.m3u8. Remember his ID.
After enabling authorization, the stream will require a token for authorization. Create a token:
Open a web browser and in the url bar - execute a request to token-generator :
a01is the ID of our test stream). we will receive a token with a lifetime of 3 hours:
Each new request to the generator will generate unique tokens.
Now, to view the stream - we will use the link:
That is, a token is added to the stream address.