This is a system design question about creating a messaging application (like WhatsApp or FB messenger).
CodePudding user response:
As mentioned in the documentation, your backend EC2 servers can send messages to the connected clients directly via the @connections
API. This documentation page walks you through how to do that.
For this, you'll need to add the connectionId to the header. See this answer on how to do so.