Network
my.onSocketMessage
Listen for WebSocket messages.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Listen for WebSocket messages.
| Property | Type | Required | Description |
|---|---|---|---|
| callback | Function | Yes | Handler for messages |
| Property | Type | Description |
|---|---|---|
| data | String/ArrayBuffer | Messages returned by the server, in text string or base64 encoded string |
| isBuffer | Boolean | If the value of this field is true, the data field represents the received base64 encoded binary strings. If the value of this field is empty, the data field represents normal strings |
my.onSocketMessage((res) => {
console.log('Received:', res.data);
});