Max Lv:meow-rs 多路复用 WebSocket 修复已本地复核通过,补充说明后待 CI 通过合并
Max Lv 复核 meow-rs PR #745(稳定多路复用 WebSocket 连接):在 macOS 本地验证新增 ws_test、mux 库与 api_test 的 DNS 用例通过,fmt、三路 clippy、rustdoc 干净。他在原提交上追加了一个小提交 dc72528:为 ws.rs 的 16 KiB 单次 poll_write 上限与 64 KiB tungstenite 写缓冲上限命名并加 const 断言关联,更新过时的 ws_config() 文档注释;muxcool.rs 的 MAX_UDP_PAYLOAD 改为从 MAX_PAYLOAD 派生。两点记录、不要求改动:write_packet 对超大报文返回 Err 会让 meow-tunnel 驱逐该 UDP NAT 条目(下一个包重新拨号建流),与 SS/SOCKS5/Trojan/anytls 现有行为一致,比丢掉整个 mux 会话好;vless/conn.rs 的纯 VLESS UDP writer 仍只守 u16::MAX,值得单独检查 Xray 的 packet reader 是否也施加 8 KiB 上限。CI 在新 head 上通过后即 squash-merge。
作者原文@madeyeReviewed, thanks. Verified locally on macOS: the new
ws_test, mux lib andapi_testDNS cases pass, and fmt / three-way clippy / rustdoc are clean.I pushed one small follow-up commit (dc72528) on top of yours rather than round-tripping:
ws.rs: named the 16 KiB per-poll_writecap and the 64 KiB tungstenite write-buffer ceiling (WS_WRITE_CHUNK,WS_MAX_WRITE_BUFFER) with a const assert tying them together, and refreshed thews_config()doc comment that still said every write is a single relay-buf chunk.muxcool.rs:MAX_UDP_PAYLOADnow derives fromMAX_PAYLOADsince both come from Xray'sbuf.Size.Two notes for the record, no change requested:
- Returning
Errfromwrite_packetfor an oversized datagram makesmeow-tunnelevict that UDP NAT entry (next packet redials a mux stream). That matches what the SS/SOCKS5/Trojan/anytls writers already do, and it is far better than losing the whole mux session, so I kept it.- The plain VLESS UDP writer in
vless/conn.rsstill only guardsu16::MAX; worth checking separately whether Xray's packet reader applies the same 8 KiB bound there.Will squash-merge once CI is green on the new head.