WebSocket
WebSocket
A way to keep a connection open between the server and the browser, like a phone line, so new updates are sent right away.
💡 Normal requests are like texting back and forth. A WebSocket is a phone call you keep on.
🤖 Say this to your AI
Make the chat feature real-time. New messages should show up right away without refreshing, and recommend a way to do it with the service I'm using (like Supabase Realtime).
The key word is ‘WebSocket’. Including it helps AI understand you much more precisely.
📌 Good to know
On serverless hosts like Vercel, it's hard to open WebSockets yourself. Real-time services like Supabase Realtime, Pusher, or Ably make it easy.
When to use it
- When new messages need to pop up instantly, like in a chat
- Live notifications, stock prices, games
- When several people edit the same document at once
Also called: websocket, web socket, socket, socket.io, realtime, real-time, live chat, live updates, push