I'm using Node RED to get data from Firebase Realtime Database now.
As i know, unlike typycal HTTP, Firebase using "something" to remain a connection with a client, so data will be updated realtime (like websocket).
So does Node RED and Firebase use websocket to get data too?
i use this one https://flows.nodered.org/node/node-red-contrib-firebase
When you install Node-RED it doesn't come with any nodes for Firebase so you must have installed some yourself. If you want the definitive answer you will need to determine the full name of the node you are using https://flows.nodered.org/?term=firebase&type=node&num_pages=1 and try adding that info to your question (and the title)
You could also investigate yourself by following the link to the nodes source code (generally on github) and either looking at the source yourself or asking the author.
i use this one. Thanks for your advice
Like ukmoose set, to get the answer digging in the source gives often the clue. The node itself uses the official firebase js SDK. Under the hood, xmlhttprequest is used, as well as faye-websocket
. So websockets indeed. Each of the libraries in the SDK comes with their own package.json to check the dependencies. To figure out how it actually works, you’ll have to read the code, which I’ll readily admit I did not do. It’s written in TypeScript, and I’m not exactly a fan of reading that.