fix(gateway): 解决 WebSocket 升级和 HTTP 请求处理问题

- 使用 RawWriter() 获取原始的 http.ResponseWriter,避免 gf 框架的封装影响
- 确保代理能够正确处理 WebSocket 连接升级
- 修复了因框架封装导致的响应写入问题
This commit is contained in:
2026-03-06 11:35:25 +08:00
parent 737fd041a0
commit f958579981
+2 -1
View File
@@ -61,5 +61,6 @@ func BuildRequest(r *ghttp.Request, host string) {
}
// ServeHTTP 会自动处理 WebSocket 升级和所有 HTTP 方法
proxy.ServeHTTP(r.Response.Writer, r.Request)
// 使用 RawWriter() 获取原始的 http.ResponseWriter,避免 gf 框架的封装影响
proxy.ServeHTTP(r.Response.RawWriter(), r.Request)
}