uce/site/doc/pages/ws_message.txt
2026-06-15 11:04:16 +00:00

21 lines
635 B
Plaintext

:sig
String ws_message()
:params
return value : payload of the current WebSocket message
:see
>websocket
:content
Returns the payload of the current WebSocket message being handled by `WS(Request& context)`.
For text frames this is the decoded text payload. For binary frames this `String` contains the raw message bytes.
Use `ws_is_binary()` or `ws_opcode()` to choose how to parse the payload.
Related:
- PHP: WebSocket connection metadata and send APIs in Ratchet, Workerman, or similar server frameworks
- JavaScript / Node.js: browser `WebSocket` properties and Node `ws` server-side connection inspection and send methods