-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Reverse proxy for Server-Sent Events #1172
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Any ideas/recipe to implement SSE on Echo? |
Probably by adding Line 279 in 61422dd
also removing this case statement and letting it to fall into Lines 256 to 260 in 61422dd
but this need some solid test cases and/or explanation how to test it. |
@aldas @vishr Is this still an issue? And is the recommended resolution still the same? If so, my understanding is that I would need to modify the Echo source to get this working, i.e. there is no callback or hook or function parameter that can be set, without modifying the source, that would fix this issue. |
I think this issue has been addressed now. See #2624 . Release 4.12.0 contains this fix https://github.com/labstack/echo/releases/tag/v4.12.0 |
The Proxy middleware currently doesn't support Server-Sent Events. A HTTP request expecting a
text/event-stream
response is discarded because of this line inproxy.go
. I guess it may be an expected behavior, however adding support for SSE would be very nice.To solve this, we could use a
httputil.ReverseProxy
with aFlushInterval
of ~100ms. We could add a new proxyHTTP factory like so :Then use it in the switch statement
This may introduce performance issues but since it's reserved for specific use cases, it shouldn't be a problem.
Btw, Echo is an awesome framework, loving it !
The text was updated successfully, but these errors were encountered: