Realtime Monitor
Test WebSocket and Server-Sent Events endpoints from Axil Studio - connect, send messages, and filter, pause or clear a live event log.
The Realtime view (#/realtime, shortcut g r) lists the WebSocket and Server-Sent Events (SSE) endpoints Studio found in your source and gives each one a tester with a live log. The page header shows how many connections are live, and the sidebar count is the number of detected channels.
How endpoints are detected
Studio scans the files in src/; it does not query your running app.
WebSockets: a WSServer(...) call whose options contain a literal path:
1import { WSServer } from '@axiljs/websocket'
2
3const wss = new WSServer(server, { path: '/ws' })
4wss.on('connection', client => { /* ... */ })The event list for that endpoint is every name passed to a .on('...') call in the same file.
SSE: a file that mentions text/event-stream, res.sse or SSEStream. In such a file, every string literal that starts with / and contains stream, sse or events is listed as an SSE endpoint, with the events message, error and close.
When nothing is found, each section shows how to add one and suggests Refresh data.
Endpoint cards
Each endpoint is a card with:
- A
WSorSSEtag, the path and the full URL (ws://localhost:3000/wsorhttp://localhost:3000/events). - A state indicator: Disconnected, Connecting…, Connected (WebSocket) / Listening (SSE), or Error.
- Connect / Disconnect for WebSockets, Listen / Stop for SSE.
- The detected event names, as tags.
The browser connects directly to your app (these connections do not go through the Studio proxy). Connections stay open while you switch to other views and come back.
WebSocket tester
The message box starts with {"type": "ping"}.
- Format JSON pretty-prints the message (a warning appears if it isn't valid JSON).
- Template chips: one per detected event (up to six, or
pingwhen none were found). A chip fills the box with{"type": "<event>", "data": {}}. - Send (or
Ctrl Enter/Cmd Enter) sends the box content as a text frame. The text stays in the box for quick resending. Sending requires an open connection.
SSE tester
Listen opens an EventSource to the endpoint. Unnamed messages are logged as they arrive, and each detected event name other than message gets its own listener, so named events are logged with their event name. On an error the stream is closed and the card shows Error.
Note
Because the browser connects from the Studio origin (app port + 1) to your app, an SSE endpoint must send CORS headers that allow the Studio origin. The error message in the log reminds you of this.
Event log
Every card has a log of up to the last 500 events:
| Entry | Meaning |
|---|---|
| Arrow down | Received from the app |
| Arrow up | Sent from Studio |
| Dot | System event (connecting, connected, disconnected with close code and reason) |
| Alert | Error |
Each entry has a timestamp; JSON payloads are pretty-printed and highlighted, and binary WebSocket frames show as <binary frame>.
| Control | Action |
|---|---|
| Filter log… | Show only entries whose text or event name contains the filter |
| Pause | Stop updating the log on screen (events are still recorded); resume to catch up |
| Auto-scroll | Keep the newest entry in view (on by default) |
| Clear | Empty the log without disconnecting |
The event count next to the controls shows the total number of recorded events.
Was this page helpful?