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

umijs4由于无法配置decServer中的compress属性 导致无法实时输出sse请求的数据 #11453

Closed
ghost opened this issue Jul 26, 2023 · 4 comments

Comments

@ghost
Copy link

ghost commented Jul 26, 2023

What happens?

umijs4由于无法配置decServer中的compress属性 导致在无法实时输出sse请求的数据

Mini Showcase Repository(REQUIRED)

Please provide a minimal reproduction then upload to your GitHub. 请提供 最小重现,并上传到你的 GitHub 仓库

  1. 你们自己后端写一个sse的service
  2. 在前端调用这个service (通过proxy调用)
  3. sse请求变成了一个普通的post请求,无法实时输出结果

How To Reproduce

Steps to reproduce the behavior: 1. 2.

Expected behavior 1. 2.

  1. 你们自己后端写一个sse的service
  2. 在前端调用这个service (通过proxy调用)
  3. sse请求变成了一个普通的post请求,无法实时输出结果
    (不太理解 chainWebpack都无法覆盖????????????????)

Context

  • Umi Version: 4
  • Node Version: 18
  • Platform:
@github-actions
Copy link

由于缺乏足够的信息,我们暂时关闭了该 Issue。请修改(不要回复) Issue 提供最小重现以重新开启。谢谢。

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 26, 2023
@umijs umijs deleted a comment Jul 26, 2023
@fz6m
Copy link
Member

fz6m commented Jul 26, 2023

通过 proxy 选项自定义 proxy 相关的配置。

参考 devServer 选项怎么配置 自定义提供服务的 express 中间件,支持任何自定义行为。

onBeforeMiddleware 可以拿到 express 实例,具体怎么实现自行决定即可。

@umijs umijs locked as resolved and limited conversation to collaborators Jul 26, 2023
@xiaohuoni
Copy link
Member

@microsoft/fetch-event-source

@fz6m
Copy link
Member

fz6m commented Mar 17, 2024

关于 SSE 不能流式返回的问题,增加了一个 UMI_DEV_SERVER_COMPRESS=none umi dev 的环境变量来关闭影响 SSE 的压缩中间件,用于 SSE 的测试,预计在下个版本可用。

See #12144

@umijs umijs unlocked this conversation Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants