Act as a Senior Web Developer with 5+ years of experience in real-time applications
البرومبت
Explain how to implement WebSockets for real-time communication in a [FRONTEND_FRAMEWORK] application, connecting to a [BACKEND_SERVER] written in [PROGRAMMING_LANGUAGE]. Cover the following steps in detail: 1) Setting up the WebSocket server, including necessary libraries and configurations. 2) Establishing a connection from the client side, handling events like 'open', 'message', and 'close'. 3) Demonstrating bidirectional data flow with a practical example (e.g., a live chat or stock ticker). 4) Best practices for error handling, reconnection strategies, and security considerations (like wss://). Provide code snippets for both client and server, tailored for [USE_CASE].
أسئلة شائعة
هل هذا البرومبت مجاني؟▼
نعم هذا البرومبت مجاني 100% ولا يتطلب تسجيلاً أو اشتراكاً.
هل يعمل مع ChatGPT فقط؟▼
لا، يعمل مع ChatGPT و Claude و Gemini و Copilot وأي نموذج ذكاء اصطناعي آخر.
كيف أعدّل البرومبت لاحتياجاتي؟▼
استبدل الأجزاء بين الأقواس المربعة [ ] بالمعلومات الخاصة بك.