Skip to content

An Example of using Server Sent Events with Shared Workers

License

Notifications You must be signed in to change notification settings

AnnaDamm/sse-with-shared-workers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is an example on how Server Sent events can be used together with Shared workers to reduce connections.

Prerequisites

  • PHP >= 7.3

Usage

To start the server:

    composer run start

Open either with-worker.html or without-worker.html in the browser. To use a worker, you need some sort of webserver (nginx, apache) when opening the with-worker.html, because the browser cannot load the worker file directly from the file system.

It is also possible to use PHPStorm's "Open in: Browser" feature to open the HTML file.

Debug shared worker

In chrome, open: chrome://inspect/#workers and click on inspect of the service worker

In Firefox, open: about:debugging#/runtime/this-firefox and click on Inspect of the service worker

About

An Example of using Server Sent Events with Shared Workers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published