Expert
WebSocket Auth Pattern
Secure WebSocket authentication with JWT and rooms
Full Prompt
Implement a secure WebSocket authentication pattern using JWT tokens with handshake validation, token refresh on expiration, connection rate limiting, room-based access control, message validation with Zod schemas, graceful reconnection with exponential backoff, and horizontal scaling with Redis pub/sub
Works with
✨GPT-4o✨Claude 3.5 Sonnet✨Cursor
Beginner Rating
4.7(2,600)
Stats
5,800Views
1,200Copies
2,600Likes
1,200Saves