RadioService

WebSocket channel-based messaging for testing

Endpoint

SchemeURL
TLS (port 443)wss://webservice.toscacloud.com/ws/radio?channel=<name>

Only wss:// is available on this site. The local Docker stack also serves ws://<host>:8080 and wss://<host>:8443.

Query Parameters

ParameterDefaultDescription
channeldefaultChannel to join. Clients on different channels are isolated from broadcasts. Up to 64 characters: letters, digits and _ - . :; anything else is refused with 400.
intervaloffWhen set, the server pushes the text #N broadcast message. (N counts from 1) to all clients of the channel every interval milliseconds. Values below 100 are raised to 100.
limit1000Number of pushed messages after which the server stops pushing. The connection stays open. Only meaningful when interval is set. Values above 1000 (and no value) mean 1000.
handshakefalseExtra on this site: with handshake=true the server first sends {"clientId":"a1b2c3","channel":"news"}. Without it the server sends nothing until something is broadcast; the Docker stack never announces the client id.

Sending Messages

Broadcast - send any text. All clients on the same channel receive it, including the sender.

hello everyone

Unicast - prefix with @{clientId} to target one specific client, regardless of channel. Only the target receives it; the sender gets no echo. Silently dropped if the client is not connected. Use handshake=true to learn your client id.

@a1b2c3 hello, just you

Quick Test (Browser Console)

Open this page, then open two browser consoles on it (browsers may only connect from the site's own origin) and run in each:

const ws = new WebSocket("wss://webservice.toscacloud.com/ws/radio?channel=test&handshake=true");
ws.onmessage = e => console.log("received:", e.data);
ws.onopen    = () => console.log("connected");

Broadcast from tab 1:

ws.send("hello from tab 1");

Unicast from tab 1 to tab 2 (use the clientId from the handshake message of tab 2):

ws.send("@<clientId> private message");

Quick Test (wscat)

npx wscat -c "wss://webservice.toscacloud.com/ws/radio?channel=test"

Receive 5 pushed messages at 1-second intervals:

npx wscat -c "wss://webservice.toscacloud.com/ws/radio?channel=test&interval=1000&limit=5"

Limits

Notes

← Back