aboutsummaryrefslogtreecommitdiff
path: root/mock/index.mjs
blob: 915b18ac57d52b2174eeacada87bf68b8b213bda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { WebSocketServer } from 'ws';

const wss = new WebSocketServer({ port: 8080 });

wss.on('connection', function connection(ws) {
  console.log("Connected");
  ws.on('message', function incoming(message) {
    console.log('received: %s', message);
  });

  ws.send(JSON.stringify({
      type: "execute",
      data: "/say Owo"
  }));
});
console.log("Listening..");