Installation
Server Setup
Create catch-all API route atapp/api/socket/[[...path]]/route.ts:
Environment Configuration
Create.env.local:
Client Component
Createapp/components/SocketClient.tsx:
Usage in Page
Development
http://localhost:3000
Deployment
Vercel
-
Add environment variable:
-
Deploy:
Configuration
For production, use managed Redis (Upstash recommended):Next Steps
- Express Setup - Express.js integration
- Redis Setup - Redis configuration
- Deployment - Production deployment