Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My favorite plain text protocol is HTML server sent events, within HTTP. It's really trivial to make a server produce these -- it's just some simple newline-delimited printfs() to the socket -- and they manifest client-side as simple event objects.

https://html.spec.whatwg.org/multipage/server-sent-events.ht...



Don't you have to deal with the problem of having a double newline in the field? Any time the value has a newline you have to restart with the field name, colon, and space. So it's not quite trivial to produce.


I thought server sent events were dead, or am I thinking about something else?


They are simple, but it's very slow, in my experience.


Slower than websockets or WebRTC?


The usage I've seen is to send log lines. In that case it's a lot slower than bundling stuff up into single requests/responses over HTTP.


You mean, using server-sent events for things that are not events but data, one row at a time?

Of course that'd be slow, but that's equivalent to sending one websocket frame for each row, or one file per row over HTTP multipart. Hardly talks to the speed of either protocol.


I disagree. SSE makes one design easier. If that's great, great. If not, not. But per-unit SSE is ships more slowly because it doesn't allow for easy batching.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: