You should store your message in local or an online database. WebSocket used to get live messages when you receive them , store them in a database then fetch them when you requires them. You can check Baserow. It have web socket feature with database where web socket is just used to get live updates and the data is stored normally in tables that can be fetched after.
I don’t know. You can check once and if you get any result then post it here also so it can help others.