<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>websocket on Ikoma's Blog</title><link>https://blog.yusukeikoma.com/tags/websocket/</link><description>Recent content in websocket on Ikoma's Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 22 Sep 2026 13:39:45 +0900</lastBuildDate><atom:link href="https://blog.yusukeikoma.com/tags/websocket/index.xml" rel="self" type="application/rss+xml"/><item><title>Durable Object Hibernation Keeps the WebSocket and Drops Every Class Field</title><link>https://blog.yusukeikoma.com/posts/durable-objects-websocket-hibernation/</link><pubDate>Tue, 22 Sep 2026 13:39:45 +0900</pubDate><guid>https://blog.yusukeikoma.com/posts/durable-objects-websocket-hibernation/</guid><description>Cloudflare&amp;rsquo;s docs say hibernation keeps WebSocket connections open and discards in-memory state. This post runs a small Durable Object under local workerd and watches exactly what that means: the socket stays OPEN, the constructor runs again on the next message, class fields reset, attachments survive only if you serialize them, and a pending timer or the standard WebSocket API quietly turns hibernation off. Production behaviour and billing are not tested.</description></item><item><title>After Backgrounding, a WebSocket Reporting OPEN Is Only a Claim</title><link>https://blog.yusukeikoma.com/posts/mobile-os-background-sockets/</link><pubDate>Sat, 12 Sep 2026 14:18:24 +0900</pubDate><guid>https://blog.yusukeikoma.com/posts/mobile-os-background-sockets/</guid><description>Apple&amp;rsquo;s and Android&amp;rsquo;s own documentation say a backgrounded app can be suspended, its network access deferred, and its existing connections closed. So when your app comes back, readyState === OPEN is only a memory of the last event, not a measurement. This post derives a small foreground routine (probe, rebuild, catch up) from those documented rules, runs it against a frozen-process stand-in on Linux, and is explicit about what no device was used to check.</description></item><item><title>A WebSocket Origin Check Blocks Other Websites, Not Other Clients</title><link>https://blog.yusukeikoma.com/posts/websocket-origin-check-is-not-authentication/</link><pubDate>Thu, 10 Sep 2026 11:23:25 +0900</pubDate><guid>https://blog.yusukeikoma.com/posts/websocket-origin-check-is-not-authentication/</guid><description>The Origin header on a WebSocket handshake is set by browsers and can be set to anything by every other client. So an allow-list protects a cookie-authenticated browser session from other sites, and it proves nothing about who is connecting. A runnable server, a real headless-browser attack, and the handshake rule that follows.</description></item><item><title>Waiting for bufferedAmount Protects the Sender, Not a Slow Consumer</title><link>https://blog.yusukeikoma.com/posts/websocket-bufferedamount-backpressure/</link><pubDate>Sun, 06 Sep 2026 20:54:24 +0900</pubDate><guid>https://blog.yusukeikoma.com/posts/websocket-bufferedamount-backpressure/</guid><description>WebSocket send() never waits, and bufferedAmount only sees the part of the path that is in your own process. In a small lab, a sender that politely waited for bufferedAmount to drain still let a slow consumer queue nearly all 400 messages in its own memory, while a credit window of 8 kept the backlog at 8. This post goes through four common beliefs about send(), bufferedAmount, message size and backpressure, tests each one, and ends with a table for choosing between them.</description></item><item><title>When a WebSocket Outlives Its Token</title><link>https://blog.yusukeikoma.com/posts/websocket-reauthentication-on-long-lived-connections/</link><pubDate>Fri, 21 Aug 2026 13:34:18 +0900</pubDate><guid>https://blog.yusukeikoma.com/posts/websocket-reauthentication-on-long-lived-connections/</guid><description>After the 101 response, no request carries credentials: the server remembers a verdict, not the evidence. This article follows one token through a browser handshake, shows what a page can and cannot see, and compares three ways to renew it (reconnect, in-band, out-of-band) with a runnable server, tests, and a headless-Chrome check.</description></item><item><title>Replace Polling with Change Subscriptions, and Keep the Poll as the Fallback</title><link>https://blog.yusukeikoma.com/posts/replace-polling-with-subscriptions-keep-poll-as-fallback/</link><pubDate>Thu, 20 Aug 2026 18:03:49 +0900</pubDate><guid>https://blog.yusukeikoma.com/posts/replace-polling-with-subscriptions-keep-poll-as-fallback/</guid><description>How a mobile client moved from timer-driven polling to shared change subscriptions over a per-message-billed relay. The subtle part is not the stream. It is deciding honestly when the fallback poll may stand down.</description></item><item><title>Batching and Bounded Frames on a Metered Relay</title><link>https://blog.yusukeikoma.com/posts/batching-and-bounded-frames-on-a-metered-relay/</link><pubDate>Wed, 19 Aug 2026 12:47:53 +0900</pubDate><guid>https://blog.yusukeikoma.com/posts/batching-and-bounded-frames-on-a-metered-relay/</guid><description>When every WebSocket message costs money and every frame has a hard cap, you need batching with independent flush triggers, a single-frame threshold below the cap, bounded chunking, and capability flags that survive mixed-version rollouts. The sharp edges are ordering on shutdown and a zero value that disappears from the wire.</description></item><item><title>Liveness Without Pings, and Idle Sleep</title><link>https://blog.yusukeikoma.com/posts/liveness-without-pings-and-idle-sleep/</link><pubDate>Tue, 18 Aug 2026 22:41:09 +0900</pubDate><guid>https://blog.yusukeikoma.com/posts/liveness-without-pings-and-idle-sleep/</guid><description>A fixed-interval keepalive costs a message in each direction even when the connection is busy. Treating every inbound frame as proof of life, probing only quiet connections, and letting an existing heartbeat tell an idle host when to disconnect removes most of that traffic, at the price of a bounded wake-up delay.</description></item><item><title>When the Close Event Never Comes</title><link>https://blog.yusukeikoma.com/posts/when-the-close-event-never-comes/</link><pubDate>Mon, 17 Aug 2026 17:27:04 +0900</pubDate><guid>https://blog.yusukeikoma.com/posts/when-the-close-event-never-comes/</guid><description>A client that waits for its own socket&amp;rsquo;s close event before cleaning up can stall silently when that event never arrives. Settle your state when you decide to end the connection, make the cleanup idempotent, and keep the event for closes you did not start.</description></item></channel></rss>