Skip to content

Server-Sent Events (SSE) - add Keep-Alive Messages definition #7571

Open
@liran2000

Description

"...authors can include a comment line (one starting with a ':' character) every 15 seconds or so."

This is helpful for SSE clients. The SSE client can read the keep-alive messages, and detect whether the connection is alive.

Thing is, since the keep-alive messages mechanism is not mandatory, the SSE client can use this condition only if the keep-alive mechanism is used, since when it is not used, it is a valid scenario that no message is received for a long time, even when the stream is alive.

Problem:
keep-alive message is not well-defined.
Suggested solution - edit:
authors can include a comment line (one starting with a ':' character) starting with ":keepalive" every 15 seconds or so.

This way, the SSE client can detect if keep-alive mechanism is used by checking if it received a keep-alive message as defined.

Opened PR for the solution:

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions