Some of what you need to know is contained in this FAQ post, containing advice on how to safely access node-red over the internet.