Still testing nodes for mp4 video streaming

continued from the other thread that closed...

npm install kevinGodell/node-red-contrib-mp4frag
npm install kevinGodell/node-red-contrib-ui-mp4frag

Some new features are designed with security in mind.

To secure the http routes, you can add a custom middleware function that can be used to limit access to hls.m3u8, video.mp4, etc. It is to be defined in the settings.js file.

mp4frag: {
  middleware: (req, res, next) => {
    console.log('mp4frag middleware');
    next();
  }
},

For socket io connections, the server side now generates a random key each time the node is initialized. It is passed in the payload so that it may be given to a client to use for connecting. This is done because I go straight to websockets, skipping the polling step, which gives me less options for verifying the client connection. Skipping the polling option with socket io allows me to get video delivered sooner and it also gives flexibility for playing video via socket io on another server without playing with cors.

Both nodes still can work with socket io v2 or v3. So if you need the performance benefits of v3, you can install my fork of node-red-dashboard that uses socket io v3 as a dependency vs the master that uses v2.

npm uninstall node-red-dashboard
npm install kevinGodell/node-red-dashboard

p.s. installing kevinGodell/node-red-dashboard from git takes a very long time and appears to freeze. give it probably more than 5 minutes.

4 Likes