Implement WebSocket Connections
Get production-ready WebSocket code with error handling, authentication, and real-time features. Perfect for chat apps and live updates.
Prompt Template
Variables to Customize
[APPLICATION_TYPE] The type of application you're building
Example: real-time chat application
[SERVER_TECHNOLOGY] Backend technology stack
Example: Node.js with Express and Socket.IO
[MAX_CONNECTIONS] Expected concurrent connection limit
Example: 1000
[AUTH_METHOD] Authentication mechanism
Example: JWT tokens
[MESSAGE_TYPES] Types of messages the system should handle
Example: text messages, file uploads, typing indicators, user presence
[CLIENT_TECHNOLOGY] Frontend technology for the client
Example: JavaScript/React
[SPECIFIC_FEATURES] Custom features specific to your application
Example: private messaging, group chats, message history, user status updates
Example Output
Pro Tips for Best Results
- Always implement proper error handling and reconnection logic to handle network interruptions gracefully
- Use authentication middleware to secure your WebSocket connections and prevent unauthorized access
- Implement rate limiting and message validation to protect against spam and malicious attacks
- Add heartbeat/ping-pong mechanisms to detect dead connections and clean up server resources
- Consider using Redis for scaling WebSocket connections across multiple server instances in production
Tags
Want 500+ Expert Prompts?
Get the Premium Prompt Pack — organized, tested, and ready to use.
Get it for $29Related Prompts You Might Like
Generate Docker Compose Configuration Files
You are an expert DevOps engineer specializing in containerization and Docker Compose. I need you to create a comprehens...
Create a Complete CI/CD Pipeline
You are a Senior DevOps Engineer tasked with designing a comprehensive CI/CD pipeline. Create a complete pipeline config...
Design Database Schema
You are an experienced database architect. I need help designing a comprehensive database schema for [APPLICATION_TYPE]....
Fix Memory Leak in Application
I need help debugging a memory leak in my [PROGRAMMING_LANGUAGE] application. Here are the details: **Application Conte...
Implement OAuth 2.0 Authentication System
I need to implement OAuth 2.0 authentication for my [APPLICATION_TYPE] application using [PROGRAMMING_LANGUAGE] and [FRA...
Implement Search Functionality
I need to implement search functionality for my [APPLICATION_TYPE] application. Here are the key requirements: **Techni...