You know the phrase - there's no such thing as a stupid question....
I know how to spell websickets but that's about as far as it goes but I've managed to get a Scratch extension to connect to a websocket listener (if thats the right terminology) running on Node-RED
Is there a particular reason that you are using scratch and trying to connect it with NR? There is a blockly node available for NR that will allow you to use that programming interface directly in Node-red instead of a function node. Just FYI.