Server-sent events: a simple way to stream events from a server

By Julia Evans - 2021-03-01

Description

Server-sent events: a simple way to stream events from a server

Summary

  • a simple way to stream events from a server hello!
  • Here I have a handler that just receives events with type panda (like our server was sending in the previous section).
  • So you have to explicitly close the connection by calling .close() if you don’t want the client to keep retrying.
  • I’m not sure exactly why using HTTP/1.0 made the client close the connection (maybe because the server writes 2 newlines at the end of each event?
  • ),

 

Topics

  1. Backend (0.11)
  2. Management (0.08)
  3. Frontend (0.07)

Similar Articles

Fostering team spirit remotely

By Medium - 2020-12-01

How we organised after a move to remote work to keep an organisation of 200 people engaged and happy.

Linux malware backdoors supercomputers

By Help Net Security - 2021-02-02

ESET researchers discovered Kobalos, a malware that has been attacking supercomputers – high performance computer (HPC) clusters.

RxJS in Angular: Part III - RxJS inDepth

By inDepthDev - 2021-01-22

In my previous two articles we have discussed how to change our components which solve problems in imperative ways to do that in functional, reactive, RxJS way, and we of course had a lot of fun doing ...