Environment for running serviceworkers in node.js, as 'isomorphic' request handlers for clients without SW support.
Features and status
Based on this task.
- Registration to a scope. This introduces a very basic routing scope, but finer-grained routing is normally happening inside the service worker.
fetch, via https://github.com/gwicke/node-fetch
- This also provides a basic
Responseimplementation, wrapping the node HTTP response object.
Requestwrapper for Node's IncomingMessage.
- Cache. On the server, this is useful for in-process caching of frequently-used fragments.
ReadableStreambody responses in
- IndexedDB, via https://github.com/dumbmatter/fakeIndexedDB
- Runs basic sw-toolbox based ServiceWorkers.
- Periodic ServiceWorker code refreshs.
- Per-domain configuration support.
A demo service based on node-serviceworker-proxy is running at https://swproxy.wmflabs.org/wiki/Foobar. This is serving a demo streaming serviceworker, which composes templates and streamed HTML content using web-stream-util and web-html-stream.
- More closely implement
WorkerGlobalScope. Roughly in order of importance:
consolehas a lot more methods in browsers than in node
performanceobject: Lots missing.
navigatorobject: Partly done, but more to do.