123456789101112131415 |
- class WebsocketUtil {
- };
- WebsocketUtil.ProtectInput = "protectinput";
- WebsocketUtil.OpenInput = "openinput";
- WebsocketUtil.sendString = function(socket, message) {
- socket.sendUTF(JSON.stringify({ type: 'output', data: message}, null, "\t"));
- };
- WebsocketUtil.sendInstruction = function(socket, instruction) {
- socket.sendUTF(JSON.stringify({ type: 'instruction', data: instruction}, null, "\t"));
- };
- module.exports = WebsocketUtil;
|