Set up and connect socket.io functionality