node data detalis

master
louisa 1 year ago
parent e247bfd187
commit c8f367092e

@ -22,19 +22,18 @@ app.use(express.static(path.join(__dirname, "public")));
var io = require('socket.io')(server);
io.on('connection', function(socket){
io.on('connection', function(socket){
parser.on('data', function(data) {
const msg = data.split(' ');
console.log(msg[0], msg[1]);
io.emit(msg[0], msg[1]);
io.emit('node-data', data);
});
console.log('Node.js is listening!!');
socket.on("hello", (arg, callback) => {
console.log("hellohelo"); // "world"
io.emit('world');
socket.on("blink", (arg, callback) => {
io.emit('blink');
});
socket.on('chat message', (msg) => {

Loading…
Cancel
Save