Skip to main content

Broadcast websocket stream

Every metapage has a unique websocket broadcast channel where all metaframes can connect and broadcast and listen for messages. For frontend metaframes connecting only on in the browser, this is not particularly useful. However it’s much more useful to for backend containers to have a real-time bidirectional channel to other containers and frontend metaframes. This allows seamless streaming connections to any set of frontend and backend container components.

Example metapage showing multiple containers and javascript frames sending and receiving broadcast messages. If you look at the connections you’ll notice that only two metaframes are connected on the frontend: all other communication is happening via the shared websocket channel:

Code examples and websocket address

Go to menu then Settings. Scroll down to the Websocket Channel section.

  


Here you can copy the websocket address, or code examples for accessing the websocket URL

How it works

Every metapage generates an unguessable URL and injects it at runtime into the metaframes. This URL can be regenerated instantly in the metapage settings, so you can share the URL to connect different metapages, but also disconnect sharing. The channel URL is not shared to others who also do not have access to the underlying metapage.

The URL points to a websocket router system that broadcasts all messages to all listeners. There is a limit on the message size, the system is meant for low-latency small messages, sending large file blobs is currently not yet supported.