Setup socket.io base function