Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support http1 stream response #2320

Open
yejialiango opened this issue May 30, 2023 · 0 comments
Open

feat: support http1 stream response #2320

yejialiango opened this issue May 30, 2023 · 0 comments
Labels
kind/feature new feature WIP Work in progress

Comments

@yejialiango
Copy link
Contributor

支持Http1流式响应

目前Http1响应是通过fasthttp response.Read阻塞读取完整的头和响应体后再整体返回https://github.com/mosn/mosn/blob/master/pkg/stream/http/stream.go#L292,对于服务端流式响应(如server-sent event)并不友好

Your advice

  1. 可以在http1 clientStreamConnection完成响应头和体的分别读取,直接响应,后续流程兼容
  2. 参考类似于http2处理方式,读到header和body后交给后续流程处理,后续流程通过pipe buffer回写

Environment

  • MOSN Version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature new feature WIP Work in progress
Projects
None yet
Development

No branches or pull requests

3 participants