This flow allows you to securize your communication between Node-RED and OBS Websocket.
Authentication with OBS Websocket is a bit messy. You need a specific flow to establish a secure channel. It is not really intuitive and took me a few hours to understand and implement. This flow is the result.
First, you need to activate authentication in OBS Websocket :
- In OBS : Tools Menu > Websocket Server Settings
- Check "Enable authentication" and add a password
To ensure a good security, you're going to need the "node-red-contrib-credentials" palette.
- Open Menu > Manage palette
- Search for "node-red-contrib-credentials" and install
Then, copy the content from the flow.json file in this repository and import it in Node-RED :
- Open Menu > Import
- Copy/Paste the content of the JSON file above
- You should end up with this :
- Triple click on the "pass" node to open its settings and put the password you created in the OBS setup in the "private" field:
Restart all your flows. After a few seconds, you should see "Authenticated" under the "Auth Status" node.
If OBS is started after Node-RED, you will not be authenticated automatically. A button is provided in the flow to trigger a new authentication. A fallback flow is also provided but the first message than you send will not be accepted by OBS.