refactor tests for readability + linting fixes
This commit is contained in:
parent
9bbabc5038
commit
57fce6d6cc
12 changed files with 123 additions and 318 deletions
|
|
@ -1,29 +0,0 @@
|
|||
const WebSocket = require("ws");
|
||||
|
||||
const testMessage = {
|
||||
content: 'Hello from test server!' ,
|
||||
context: 'test message',
|
||||
subContext: '',
|
||||
modifiers: 'ai',
|
||||
id: "0",
|
||||
time: 'test'
|
||||
}
|
||||
const wss = new WebSocket.Server({
|
||||
port: 8081
|
||||
});
|
||||
|
||||
wss.on("connection", function connection(ws, req) {
|
||||
ws.on("message", function incoming(message) {
|
||||
|
||||
console.log(message)
|
||||
if (message === 'no-token' || message === 'undefined') {
|
||||
console.log('no token to authenticate');
|
||||
ws.send('locked');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
const ip = req.socket.remoteAddress;
|
||||
console.log("received connection from", ip);
|
||||
// ws.send(JSON.stringify(testMessage));
|
||||
});
|
||||
Loading…
Reference in a new issue