ApiServer: add AsyncWebSocket at /ws; accept JSON {event, payload} (string or object) and dispatch via ctx.fire; mirror all local events to clients using NodeContext::onAny.\nNodeContext: add onAny subscriber API.\nNeoPatternService: add api/neopattern/color event to set solid color.\nCluster: centralize cluster/broadcast sending in core; services delegate.\nAPI: add generic /api/node/event and /api/cluster/event endpoints in respective services.\nTests: add ws-color-client, ws-cluster-broadcast-color, http-cluster-broadcast-color.\nDocs: add StreamingAPI.md; update README and test/README.\nFixes: robust WS JSON parsing on ESP8266 and payload handling.
19 lines
479 B
JavaScript
19 lines
479 B
JavaScript
'use strict';
|
|
|
|
const BINARY_TYPES = ['nodebuffer', 'arraybuffer', 'fragments'];
|
|
const hasBlob = typeof Blob !== 'undefined';
|
|
|
|
if (hasBlob) BINARY_TYPES.push('blob');
|
|
|
|
module.exports = {
|
|
BINARY_TYPES,
|
|
EMPTY_BUFFER: Buffer.alloc(0),
|
|
GUID: '258EAFA5-E914-47DA-95CA-C5AB0DC85B11',
|
|
hasBlob,
|
|
kForOnEventAttribute: Symbol('kIsForOnEventAttribute'),
|
|
kListener: Symbol('kListener'),
|
|
kStatusCode: Symbol('status-code'),
|
|
kWebSocket: Symbol('websocket'),
|
|
NOOP: () => {}
|
|
};
|