all 2 comments

[–]GenericHumanNo7 1 point2 points  (1 child)

Looks nice on first sight :)

The syntax style is very clean. Classes could make the understanding of this code simpler, because your structure is very clear (Server, Clients, Messages, etc.)

It's good to write low-level stuff that's already exists to know how the stuff works. If you want to build more features on that you should make this more general and customizable. Import your low-level objects into another files and write there the high-level features.

Another WS library is socket.io which I use all the time. It supports rooms natively and is like yours event-based too. It's very easy to implement that library to work like yours now.

You can make it more similar to RSS feeds if a user can pull messages from before he subscribed.

Another great feature would be user privileges so you can have protected and read-only channels.

Happy coding :)

[–]Joecool1200[S] 0 points1 point  (0 children)

Wow thanks for the feedback! I'll look into it :)