Class: WebSocketServer

SRPServerPrototype~ WebSocketServer

new WebSocketServer()

WebSocketServer (singleton)
Source:

Members

activeSockets :Array

list of active sockets
Type:
  • Array
Source:

Methods

handleAuth(ws, jsonMsg)

handle authentication (SRP)
Parameters:
Name Type Description
ws WebSocket (web socket)
jsonMsg object (JSON)
Source:

onClose(ws, err)

handler for socket close
Parameters:
Name Type Description
ws WebSocket (web socket)
err object (error object)
Source:

onConnection(ws)

handler for socket accept
Parameters:
Name Type Description
ws WebSocket (web socket)
Source:

onMessage(ws, message)

handler for socket data
Parameters:
Name Type Description
ws WebSocket (web socket)
message string (data)
Source:

send(ws, jsonMsg)

send data (JSON object as string) over socket
Parameters:
Name Type Description
ws WebSocket (web socket)
jsonMsg object (JSON)
Source: