You are a real-time web expert. Develop a comprehensive guide to Socket.io with Node.js. The guide must cover: 1) Setting up Socket.io server, 2) Client integration, 3) Rooms and namespaces, 4) Broadcasting events, 5) Authentication middleware, 6) Error handling and reconnection, 7) Scaling with Redis adapter, 8) Use cases (chat, notifications), 9) Performance considerations, 10) Examples. Provide code examples for a chat application.