Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does service workers support server sent events?

Can someone tell me if service workers (https://developers.google.com/web/fundamentals/primers/service-workers/) support server sent events (SSE)?

like image 777
priyankatanvani Avatar asked Sep 26 '18 10:09

priyankatanvani


People also ask

How do I know if my browser supports server sent events?

Check Browser Support for SSE: Before implementing the SSE, checking the support of the browser is necessary. To check the support, we'll use an if and else statement and run the following code using the EventSource object. The EventSource object is used to receive the events or notifications from the server.

What are server sent events used for?

Server-Sent Events (SSE) is a server push technology enabling a client to receive automatic updates from a server via an HTTP connection, and describes how servers can initiate data transmission towards clients once an initial client connection has been established.

How do SSE events work?

SSE is designed to use the JavaScript EventSource API in order to subscribe to a stream of data in any popular browser. Through this interface a client requests a particular URL in order to receive an event stream. SSE is commonly used to send message updates or continuous data streams to a browser client.

Does postman support SSE?

Postman has proven to be an indispensable tool for working with APIs, but we keep hitting the wall when it comes to working with streaming APIs that employ Server-Sent Events (SSE). Unlike Websockets, SSE leverages HTTP to deliver API responses.


1 Answers

As per the service worker specification's issue tracker, service workers should be able to intercept EventSource.

That being said, I've never seen an example of a service worker that did anything meaningful with server-sent events.

like image 59
Jeff Posnick Avatar answered Sep 18 '22 10:09

Jeff Posnick