ribice / goch

Self hosted live chat server written in Go
https://www.ribice.ba/goch
MIT License
198 stars 30 forks source link

Allow connecting to more than one chat simultaneously #2

Open ribice opened 5 years ago

ribice commented 5 years ago

Currently you can have only one chat per websocket connection.

This is limited in internal/agent/agent.go where Agent struct holds single Chat.

On client, this currently works by connecting to new chat and disconnecting from previous one each time a different chat is clicked. But this prevents getting messages from other chats, although you can still show number of unread messages by invoking the unread count endpoint.

joeblew99 commented 5 years ago

https://nats-io.github.io/docs/developer/concepts/seq_num.html

At the bottom it mentions a nice pattern. So you can have many chats this way with the one connection i think.