more wss testing

This commit is contained in:
2019-04-26 03:49:51 +10:00
parent d2c1ebabf2
commit dbc507900c
2 changed files with 6 additions and 2 deletions

View File

@@ -18,14 +18,16 @@ module.exports = {
wss.on('connection', function connection(ws) {
ws.on('message', function incoming(message) {
console.log('received: %s', message);
if (message == "name")
ws.send({ name: dclient.user.username })
ws.send(`something ${message}`);
});
ws.send('something');
});
server.listen(8080, "0.0.0.0");
server.listen(8080);
}
}