coder / coder/websocket

Feature Request: Enable half-closed with CloseWrite

未关闭
#507 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
Go
星标
5.5k
派生
372
PR 合并指标
30 天内没有已合并 PR

描述

I'm writing a TCP reverse proxy over Websocket and I'm trying to use this library.

However, it provides no way to close the write side only. That's needed to indicate end of stream (EOF), which gets mapped to a FIN on the TCP connection to the origin.

Looking at the code, I see that Close() runs the full handhsake. Perhaps CloseWrite could just send the close message with the normal status, but not wait for the response. And the code should not close the connection when receiving the close message. It should only do that on the explicit Close() or CloseWrite() call by the application code.

贡献指南

这个仓库没有索引到贡献指南

调研方向

首先跟踪现有的 Close() 握手流程以及处理接收到的关闭消息的代码。定义显式 CloseWrite() 应如何在不等待响应或关闭连接的情况下发出写入侧 EOF 信号,同时保留通过 Close() 完全关闭的能力;通过针对性的 WebSocket 和 TCP-proxy 测试验证行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
go
领域
networking
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。