websocket icon indicating copy to clipboard operation
websocket copied to clipboard

Extending the chat example to have multiple rooms

Open gitleet opened this issue 8 years ago • 2 comments

If I wanted to extend the chat example to support multiple rooms, am I correct to assume I will have to modify the incoming messages data structure to support a key -> channel type structure? i.e. a map of string to channel?

https://github.com/gorilla/websocket/blob/master/examples/chat/hub.go#L14

I will also need to keep track of client to room also in another map.

gitleet avatar Feb 07 '18 19:02 gitleet

See #46.

ghost avatar Feb 07 '18 19:02 ghost

Thanks gary!

gitleet avatar Feb 07 '18 19:02 gitleet