uce/doc/pages/1_WS.txt

21 lines
570 B
Plaintext

:sig
WS()
:desc
Defines the WebSocket message handler for the current `.ws.uce` page.
The same page may expose both `RENDER()` and `WS()`. `RENDER()` serves the initial HTTP response, while `WS()` is called whenever a complete WebSocket message arrives for that page.
UCE reassembles fragmented messages before calling `WS()`. Text and binary frames are both delivered. Use `ws_opcode()` and `ws_is_binary()` to distinguish them.
The `call` parameter passed into `WS()` contains:
- `message`
- `connection_id`
- `scope`
- `opcode`
- `document_uri`
:see
>websocket