socket.io setup with angularjs factory