#WebSocket
12 posts tagged with this topic. ← All tags
-
Latency budget in a real-time AI app: where the milliseconds go.
How to break down end-to-end latency in a real-time AI application and identify which hops to optimize first.
-
ws vs Socket.io: when the abstraction is worth the overhead.
ws is a minimal WebSocket library. Socket.io adds rooms, auto-reconnection, fallbacks, and events on top. What you get from each and when the tradeoffs make sense.
-
Scaling WebSocket servers: why sticky sessions aren't the only answer.
WebSockets make horizontal scaling harder than stateless HTTP. Sticky sessions are the simple solution. Redis pub/sub is the scalable one. When each approach is right.
-
WebSocket on mobile: what the OS does to your connection in the background.
Mobile operating systems aggressively manage connections when an app is backgrounded. What iOS and Android do to your WebSocket and how to handle it.
-
WebSocket authentication: passing a token without cookies.
WebSocket connections don't support Authorization headers in the browser. The patterns for authenticating WebSocket connections -- query params, first-message auth, and cookie-based approaches.
-
Broadcasting to multiple clients: the pub/sub pattern.
When a WebSocket server needs to send a message to many clients, pub/sub is the natural model. How to implement channels, subscriptions, and broadcasts in Node.js.
-
Heartbeat / ping-pong: detecting dead WebSocket connections.
A WebSocket connection can appear open while the underlying TCP connection is gone. Ping-pong heartbeats detect these zombie connections before they cause problems.
-
Reconnection with exponential backoff: handling flaky networks.
WebSocket connections drop. The reconnection strategy matters: naive immediate reconnection can overload a recovering server. Exponential backoff is the standard solution.
-
Text vs binary frames: choosing the right format for real-time data.
WebSocket supports text and binary frames. When to use each, what the tradeoffs are, and how to handle both on the client and server.
-
The WebSocket handshake: what's happening in that HTTP upgrade.
WebSocket connections start as HTTP requests. The upgrade handshake is the mechanism that switches protocols. What each header means and how the switch works.
-
HTTP keeps closing. WebSocket stays open. Here's why that changes everything.
The fundamental difference between HTTP's request-response model and WebSocket's persistent connection, and why persistent connections unlock real-time applications.
-
Background vs foreground on iOS: what happens to your WebSocket.
iOS aggressively suspends background apps to save battery. What that means for WebSocket connections and the strategies for handling the transition.