r3labs / sse

Server Sent Events server and client for Golang
Mozilla Public License 2.0
871 stars 180 forks source link

detect if data is a comment #111

Closed frederikhors closed 3 years ago

frederikhors commented 3 years ago

According to https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#event_stream_format we can send a message as a comment if it starts with ":".

Note: The comment line can be used to prevent connections from timing out; a server can send a comment periodically to keep the connection alive.