-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
SSE close event is not being forwarded to the server when using Vite as Reverse Proxy #13522
Comments
I found this workaround. |
I have tried this to listen to close events from the client using both res and req (i.e., proxyReq and proxyRes events). It is not listening to close events from the client when using EventSource, but it works when the connection is closed by the server. I will double-check for you and confirm. |
I confirm that Vite proxy is not listening to |
Important Update:
It will never work due to the first parameter is just the Client Request, not the actual streaming request.
I think it will be better as you mentioned if it is enabled by default. Whenever the proxy gets a close event, then the related proxy should be destroyed. |
Describe the bug
This is a duplicate of #12157. I am opening this bug due to it is closed and can't proceed with it.
As the title: SSE close event is not being forwarded to the server when using Vite as Reverse Proxy.
In the dev server and in the preview server, both are not forwarding the close event to the server.
After many hours of debugging, and traffic inspection, after calling sse.close(), the connection is closed between the client and the proxy, but still open between the proxy and the server!
Reproduction
#12157
Steps to reproduce
No response
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: