Secured audio streaming of Digitalocean spaces cdn

We have an nextjs application while nodejs on backend. As digitalocean spaces is s3 compatible, that is why we are using S3 sdk for uploading audios on spaces. Now we have to stream with web using nextjs and html audio player with src from spaces cdn. We are using making the audio url public.

Now what is the way to stream securely so that we can restrict piracy.

Upvotes: -1

Views: 41

Answers (1)

AKX
AKX

Reputation: 169378

Now what is the way to stream securely so that we can restrict piracy.

Signed URLs. When an user requests to stream some audio, you sign the URL of the audio asset with a short expiry time, and if Digital Ocean's infrastructure supports it, limit the signed URL to e.g. the same IP address as the user's original request.

When the signature expires, the URL is no longer valid.

This of course does not stop the user from downloading the file while the URL is valid, and doing what they like with it, but it's still much better than public URLs that are valid forever.

Upvotes: 1

Related Questions