Tuesday 29 January 2019

Can't print that someone joined the server on the console!

So in my server.js I've included this:var io = require('socket.io').listen(server);io.sockets.on('connection', function (socket) {var address = socket.handshake.address;console.log('New connection from ' + address.address + ':' + address.port);});​Do I have to write code in the client.js to print in the console that someone joined, and if "yes" - what code do I have to write.

Submitted January 29, 2019 at 09:01AM by Martixell

No comments:

Post a Comment