The broadcast method, by default, has rudimentary client filtering and only sends a message to clients other than the one that originally sent the message and only to clients connected to the same route (or “room”).
</p>
<p>
For a fully-documented version of the above example, see <ahref='https://github.com/small-tech/site.js/tree/master/examples/simple-chat'>the source code for the Simple Chat example.</a>
</p>
<p>To run that example, first clone the Site.js source code repository:</p>
<p>
To run that example, first clone the Site.js source code repository:
<p>Finally, open <ahref='https://localhost'>https://localhost</a> in multiple browser windows and play with the chat interface.</p>
<p>The WebSocket functionality is from <ahref='https://github.com/aral/express-ws'>our fork of express-ws</a> (which in turn uses <ahref='https://github.com/websockets/ws'>ws</a>). Both of those links have more usage details.</p>
<p>For full details, see the <ahref='https://github.com/small-tech/site.js/blob/master/README.md#dynamic-sites'>Dynamic Sites documentation</a> and view the <ahref='https://github.com/small-tech/site.js/tree/master/examples'>examples</a>.</p>
<p>
Finally, open <ahref='https://localhost'>https://localhost</a> in multiple browser windows and play with the chat interface.
</p>
<p>
The WebSocket functionality is from <ahref='https://github.com/aral/express-ws'>our fork of express-ws</a> (which in turn uses <ahref='https://github.com/websockets/ws'>ws</a>). Both of those links have more usage details.
</p>
<p>
For full details, see the <ahref='https://github.com/small-tech/site.js/blob/master/README.md#dynamic-sites'>Dynamic Sites documentation</a> and view the <ahref='https://github.com/small-tech/site.js/tree/master/examples'>examples</a>.