Skip to content

SSE clients in "connecting" state #58

@knopki

Description

@knopki

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions