The WebsocketServer transport handler allows the propagation of results over Websockets as a server. This transport handler can be used in both directions, other client can connect to this server to receive data and to publish data.
Options
port: The port to listen for connections
Example
PQL
TCPServer Transport Handler
input = ACCESS({ transport = 'websocketserver', wrapper = 'GenericPush', source = 'source', datahandler = 'keyvalueobject', options=[['port','3453']] } ) ) output = SENDER({ protocol = 'json', transport = 'websocketserver', sink = 'auction2_json', wrapper = 'GenericPush', options=[['port','3452']] }, TOKEYVALUE(System.nexmark:auction2) )
JavaScript Client
JavaScript Client
let ws = new WebSocket("ws://localhost:3452"); ws.binaryType = 'arraybuffer'; let decoder = new TextDecoder('UTF-8'); ws.onmessage = function(m) { console.log(decoder.decode(m.data)) };