#Broadcasting on ws to all clients
1 messages · Page 1 of 1 (latest)
There's no difference from the client's perspective with pubsub
The client just connects to a URL like ws://domain.com/something, it doesn't really care what's happening on the server
I'd follow these docs for implementing the server: https://bun.sh/docs/api/websockets#pub-sub
And on the client you just do
const socket = new WebSocket('ws://<url>')
and follow this guide for the rest: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications