Serviceworker: no way for using a websocket inside a service worker

Created on 14 Feb 2017  路  4Comments  路  Source: w3c/ServiceWorker

Connection go down when user pass from domain A to domain B then domain A. The "service" doesn t seams to work as a service in this case.

Most helpful comment

We can't keep web sockets open while the user is off the site for battery and privacy reasons. Web push is a better solution here.

All 4 comments

What would you expect to happen? What if the user is on domain B for 3 days before returning to domain A?

If it called service i would image might work in background (or simulate to work in background ) with all the resources offered by html5. The connection might remain active until server decides to close . A connection is use full if it can be used for long time . If every time user change page the connection is closed and reloaded server receives a overload , web socket was designed for removing overload in http protocol but now overload is moved in server because there is no way to keep the connection active . Service worker could keep the connection active until server business logic decide to close.

A service for definition work independently by user interaction .

We can't keep web sockets open while the user is off the site for battery and privacy reasons. Web push is a better solution here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jakearchibald picture jakearchibald  路  10Comments

jeffposnick picture jeffposnick  路  11Comments

jakearchibald picture jakearchibald  路  11Comments

cdumez picture cdumez  路  10Comments

lewispham picture lewispham  路  12Comments