Team Chat

The following example uses message filtering to send messages to members of a team in a chat application:

[Edit Live on JSFiddle] [Download]

To join a team, users set the client attribute "team" to either "red" or "blue". To send a message to the current user's team only, the application passes an AttributeFilter to the Room object's sendMessage() method.

The Code

Here is the code for the preceding example. Click the "+" button to edit it live on JSFiddle.