illuspas / Node-Media-Server

A Node.js implementation of RTMP/HTTP-FLV/WS-FLV/HLS/DASH/MP4 Media Server
https://www.npmjs.com/package/node-media-server
MIT License
5.9k stars 1.51k forks source link

Trying to publish with auth not working even follow all the step! #506

Open lyhourchhen opened 2 years ago

lyhourchhen commented 2 years ago

Maybe it is would be the silly question to open the issue but i try to publish the live with auth by follow all the guides unfortunately it is unauthorized. My simple reproduce

const config = {
  rtmp: {
    port: 1935,
    chunk_size: 10000,
    gop_cache: true,
    ping: 30,
    ping_timeout: 60,
  },
  http: {
    port: 8000,
    allow_origin: "*",
    mediaroot: "media",
  },
  auth: {
    play: true,
    publish: true,
    secret: "keykeykey",
  },
};
const md5 = require("md5");

const generateTimestamp = (date) => {
  const datum = Date.parse(date);
  return datum / 1000;
};
const time = generateTimestamp("02/22/2025 23:31:30"); 
//1740241890

const hasValue = md5(`/live/stream-${time}-keykeykey`);
//b701fbf5800981f523a06095ea400492

// i use this to publish with obs
// rtmp://ip:1935/live/stream?sign=1740241890-b701fbf5800981f523a06095ea400492

// log from server enter image description here

CameronSima commented 2 years ago

I am having the same issue. NMS doesn't appear able to pull the query params off the url

deeaamon commented 2 years ago

i am having the exact same issue

william-levi commented 2 years ago

any updates on this @illuspas ?