<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title>WebSocket - Tag - Daily Deep Think</title>
        <link>https://blog.baifan.site/en/tags/websocket/</link>
        <description>WebSocket - Tag - Daily Deep Think</description>
        <generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>blog@baifan.site (ByF)</managingEditor>
            <webMaster>blog@baifan.site (ByF)</webMaster><lastBuildDate>Tue, 31 Mar 2026 14:00:00 &#43;0800</lastBuildDate><atom:link href="https://blog.baifan.site/en/tags/websocket/" rel="self" type="application/rss+xml" /><item>
    <title>Codex Keeps Reconnecting? Four Fixes</title>
    <link>https://blog.baifan.site/en/codex-websocket-reconnect-fix/</link>
    <pubDate>Tue, 31 Mar 2026 14:00:00 &#43;0800</pubDate><author>
                    <name>ByF</name>
                </author><guid>https://blog.baifan.site/en/codex-websocket-reconnect-fix/</guid>
    <description><![CDATA[<div class="featured-image">
                <img src="/pictures/posts/codex-websocket-reconnect-solutions.svg" referrerpolicy="no-referrer">
            </div><!-- more -->
<p>Codex talks to the ChatGPT backend over WebSocket by default. If your network path involves Clash, a corporate proxy, cross-border transit, or Cloudflare challenge pages, that long-lived WebSocket gets killed easily — and you end up staring at <code>Reconnecting... 1/5</code> over and over. Turn off WebSocket and switch to plain HTTP streaming requests, and the problem mostly disappears.</p>
<figure><a class="lightgallery" href="/pictures/posts/codex-websocket-reconnect-solutions.svg" title="" data-thumbnail="/pictures/posts/codex-websocket-reconnect-solutions.svg" data-sub-html="<h2>Comparison of the four fixes</h2>"><img  loading="lazy" src='/pictures/posts/codex-websocket-reconnect-solutions.svg'     width="900px"></a><figcaption class="image-caption">Comparison of the four fixes</figcaption>
    </figure>
<h2 id="why-websocket-breaks-behind-proxies" class="headerLink">
    <a href="#why-websocket-breaks-behind-proxies" class="header-mark"></a>Why WebSocket Breaks Behind Proxies</h2><p>The WebSocket protocol starts with an HTTP Upgrade request; only after the server returns 101 does it switch to the long-lived connection. That long-lived connection is exactly where the problem sits — proxy servers, firewalls, and CDN nodes all run timeout policies on idle connections, and Cloudflare&rsquo;s challenge mechanism can inject an interstitial page mid-path. Any link in that chain kills the connection, and the Codex client starts <code>Reconnecting</code>.</p>]]></description>
</item>
</channel>
</rss>
