A simple media streaming application aimed to show how to work with streams, encrypt media links and provide with temporary access to resources.
- send all the data using NodeJS streams instead of sending entire files
- create temporary media links (with expiration date) due to the security reasons
- not reveal direct file link (link to media storage server)
API: http://localhost:3000/api/media/files/
- get file list (encrypted links) from media storage server.
Respond with 2 file links types:
- originalStream (provides a regular readable file stream)
- encryptedStream (provides with encrypted file stream, should be decrypted in order to read)
API: http://localhost:3001/media/<encrypted link>
- get a regular file stream (will be opened by browser)
API: http://localhost:3001/media/<encrypted link>/?option=encrypted
- get an encrypted file stream (won't be possible to open by default)
*Each encrypted link will be expired in 'X' second and won't be accessible due to the security reason.
Visit https://nodejs.org for installation details.
Node Package Manager, should come bundled with node.
Install Redis https://redis.io/topics/quickstart
- Create a folder with the chosen name
- Run
$ git clone <package url> .
- Access sub-applications dirs (
$cd api
,$cd media_proxy
,$cd media_storage
) - Run
$ npm install
- Check
./api/config/env/env.js
,./media_proxy/config/env/env.js
,./media_storage/config/env/env.js
- Update settings according to your needs and environment specifications
$ cd api && npm run start
$ cd media_proxy && npm run start
$ cd media_storage && npm run start