<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>im on 又耳笔记</title><link>https://youerning.top/tags/im/</link><description>Recent content in im on 又耳笔记</description><generator>Hugo -- gohugo.io</generator><language>zh-CN</language><lastBuildDate>Fri, 23 Oct 2026 21:20:00 +0800</lastBuildDate><atom:link href="https://youerning.top/tags/im/index.xml" rel="self" type="application/rss+xml"/><item><title>读 Octop 源码（9）：Dashboard 其实是个「虚拟 IM 通道」</title><link>https://youerning.top/post/octop-source/octop9/</link><pubDate>Fri, 23 Oct 2026 21:20:00 +0800</pubDate><guid>https://youerning.top/post/octop-source/octop9/</guid><description>&lt;p>前几篇一直在往上走：进程怎么起、Agent 怎么活、谁能碰谁的数据。这篇横向切一刀，读 &lt;code>infra/gateway/&lt;/code>——&lt;strong>13,857 行，第二大模块&lt;/strong>，负责所有消息的进出口。&lt;/p>
&lt;p>打开 &lt;code>ws_channel.py&lt;/code> 的第一行，我笑了：&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-python" data-lang="python">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#e6db74">&amp;#34;&amp;#34;&amp;#34;Virtual IM channel that delivers Dashboard chat over WebSocket.&amp;#34;&amp;#34;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>Dashboard 不是&amp;quot;主入口&amp;quot;，它是一个虚拟 IM 通道。&lt;/strong> 网页聊天的消息也要包成 &lt;code>InboundMessage&lt;/code>、走和飞书完全相同的管道。&lt;/p>
&lt;p>这句话是整个模块的设计前提，也是我读完之后最想写的一点。&lt;/p></description></item></channel></rss>