Replies: 2 comments 1 reply
-
@deepsoul I have the same problem I believe. Seem work fine with when the app is built but when I use vite's dev server with a proxy configure to reroute api path to my backend, SSE do not seem to work. At first I thought it was because you would need a special setup for that but I am not so sure anymore. My rationale is that after all the backend when it sees a request to open a SSE line should have the correct origin to send server sent events to in the request's "Origin" header field (http-proxy, the lib which handle proxying for vite set Moreover I see the error {"statusCode":403,"message":"sse already opened","error":"Forbidden"} Which means the server did receive the request for SSE and said "nope".
Do you know any more than I do now ? |
Beta Was this translation helpful? Give feedback.
-
I found a solution to allow proxying SSE to a dev backend. Vite's proxy configuration unfortunately doesn't allow much dynamic configuration, but I worked around it. In a key/value proxy configuration, you can implement the
The workaround magic is setup by the
Here's the magic workaround:
|
Beta Was this translation helpful? Give feedback.
-
Hi,
we wanna implement some SSE-Features in our App, but we can't handle that the evensource is captured in dev mode. What setting in vite.config is needed to develop in dev mode? When builded it works properly, but thats hard to debug, to deploy the app constantly on some PR-Branches and debug via console.log
Beta Was this translation helpful? Give feedback.
All reactions