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

SSE clients in "connecting" state #58

Open
knopki opened this issue Jan 19, 2023 · 0 comments
Open

SSE clients in "connecting" state #58

knopki opened this issue Jan 19, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@knopki
Copy link
Contributor

knopki commented Jan 19, 2023

The current SSE endpoint implementation (/stream) has a strange feature. There is no response at all until the first event. So, until the first event, clients stay in a "connecting" state. HTTP code is unknown, is connection alive is unknown.
It's very uncomfortable for client implementation, because you need to connect to the stream before making any other request, but you don't know are you connected or not. The workaround is to start ping-pong game, but it's not cool at all.

The fix is easy - just req.write(); req.flush(); after headers.
This is very connected to #57 onConnect callback can help with this.

@blokhin blokhin added the bug Something isn't working label Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants