Open channchetra opened 6 years ago
Yes you can do it with the auth feature ;)
Tell me if you need help understanding how it works !
Yes you can do it with the auth feature ;)
Tell me if you need help understanding how it works !
@SAMYEL06 Yes really need that please help
Yes. I need help with similar thing. The auth
config key seems to be working for play
but not for publish
. It's authorized anyways.
I need some help with too please.
Yes. I need help with similar thing. The
auth
config key seems to be working forplay
but not forpublish
. It's authorized anyways.
I has the same issue. Need more help too please :(
Hi All,
You need Use MD5 hash function first see this package
https://www.npmjs.com/package/node-media-server
in server side config
for example : if secret: 'nodemedia2021MYkey' <====
const config = { rtmp: { port: 1935, chunk_size: 60000, gop_cache: true, ping: 30, ping_timeout: 60 }, http: { port: 8000, allow_origin: '*' }, auth: { play: true, publish: true, secret: 'nodemedia2021MYkey' } }
for call or publish you need calculate timestamp and hash value base on that
function toTimestamp(strDate){ var datum = Date.parse(strDate); return datum/1000; }
toTimestamp('08/13/2021 23:31:30')
then You get ===> 1628861490
The combination HashValue is:
stream = /live/stream Timestamp = 1628861490 secret = 'nodemedia2021MYkey'
HashValue = md5("/live/stream-1628861490-nodemedia2021MYkey”)
HashValue = 80c1d1ad2e0c2ab63eebb50eed64201a
now you can call
rtmp://192.168.0.10/live/stream?sign=1628861490-80c1d1ad2e0c2ab63eebb50eed64201a
I'm using this server but I want to allow only publisher who has auth can public streaming to server