<p>Note that this is a naïve implementation that sends messages to every client, including the one the message originated on. For a demonstration of a basic chat server that has rudimentary client filtering and supports selective broadcast (to create “rooms”), see <ahref='https://source.ind.ie/site.js/app/blob/master/examples/wss-basic-chat/.dynamic/.wss/chat.js'>the source code for the Basic Chat example.</a></p>
<p>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”). For a fully-documented version of the above example, see <ahref='https://source.ind.ie/site.js/app/blob/master/examples/wss-basic-chat/.dynamic/.wss/chat.js'>the source code for the Basic Chat example.</a></p>
<p>To run that example with a basic web interface, do the following and then visit <ahref='https://localhost'>https://localhost</a></p>
<p>The WebSocket functionality is from <ahref='https://github.com/HenningM/express-ws/pull/122'>a slightly modified version</a> of <ahref='https://github.com/HenningM/express-ws'>express-ws</a> (which in turn uses <ahref=''>ws</a>). Both of those links have more usage details.</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://source.ind.ie/site.js/app/blob/master/README.md#dynamic-sites'>Dynamic Sites documentation</a> and view the <ahref='https://source.ind.ie/site.js/app/tree/master/examples'>examples</a>.</p>