One server-sent-events connection pushes a new price every 2 seconds. The same message also updates an out-of-band ticker, so two regions change from one response.
Restart the demo server to watch EventSource reconnect automatically.
event: price
data: <span class="price-tag">$42.00</span>
<div id="ticker" minu-oob="#ticker">tick 21 · 12:00:01 PM</div>
minu-sse="/events" opens a native EventSource on init.minu-sse-event="price" filters for the named event, not the default message.data is sanitized and swapped into #price.EventSource reconnects on its own; retry: and id: work as usual.minu.closeStream(element).<div minu-sse="/events"
minu-sse-event="price"
minu-target="#price"></div>
<script>
minu.init();
// close one stream:
minu.closeStream(document.querySelector('[minu-sse]'));
</script>
For chat, send with a normal minu-post and receive over SSE.
WebSocket is intentionally not included.