Methods
-
send( mockFile, ws, request, incomingMessage )
-
Description
Compiles and transforms the handlerbars in a given mockfile and according to the key, i.e.
- broadcast
- emit; or
- self sends the message from message.mock If it's the first message to be sent after connection, mockfile would be connection.mock
Parameters
Name Type Description mockFilestring mockFile for the current connection
wsWebSocket current socket
requestIncomingMessage incoming request
incomingMessageany incoming data
Details
-
sendConnect( ws, request, clients, clientId, status, mockFile )
-
Description
Sends a list of current clients connected to the server, id of the new client, and status (joining or leaving)
Parameters
Name Type Description wsWebSocket current socket
requestIncomingMessage Incoming request
clientsArray.<string> List of existin clients
clientIdstring new clientId
statusstring joining or leaving
mockFilestring mockfile, i.e. connection.mock
Details