I need help setting up Firebase with custom function in any language and real time database to simulate websocket from Host to Client. This service should expose an endpoint to consume from a backend application that will broadcast message to connected users. Connection both for clients and backend server needs to be authenticated and messages need to deliver a JSON payload.
Clients will be able to connect to a channel or to be a channel themselves. If they connect to a channel the entire group receives the message, if they are a channel themselves only they receive the message. Communication is ONLY host to client not viceversa (so it is not a full duplex websocket, just single).
All messages need to be stored in Database for reference with a count of recipients and these messages should be queriable from a function that allows us to synch with our own backend.
We are doing this project to replace an existing socketIO interface that is not scaling properly. It is very simple so performance, timing, pricing and quality are key. We expect a fully documented solution that acts as a blackbox for us.