Firebase sync data (data stream)

I want to know-how the APP inventor firebase component synchronized data from the real-time database while firebase does not support WebSocket protocol?
can anyone help me by telling me the technicality of this process?
especially I need the code of this process.
I need the method to apply it in the ESP8266 endpoint.