add socket.io and handle reception on client