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

2
.gitignore vendored
View File

@@ -6,3 +6,5 @@ googleapi\.json
setup.json setup.json
merged.mp3 merged.mp3
output.mp3 output.mp3
privkey.pem
cert.pem

View File

@@ -18,14 +18,16 @@ module.exports = {
wss.on('connection', function connection(ws) { wss.on('connection', function connection(ws) {
ws.on('message', function incoming(message) { 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 ${message}`);
}); });
ws.send('something'); ws.send('something');
}); });
server.listen(8080, "0.0.0.0"); server.listen(8080);
} }
} }