nodeca / tabex

Cross-tab message bus for browsers.
http://nodeca.github.io/tabex/
MIT License
219 stars 19 forks source link

One WebSocket between tabs #11

Closed Shkarbatov closed 8 years ago

Shkarbatov commented 8 years ago

Hi, trying to understand:

Share single websocket connection when multiple tabs open (save server resources).

Maybe You have any examples, how to do this? I know how to check SharedWorker count, but how I can be shure, that only one WebSocket used? As I understand, after page refresh - SharedWorker recreate anew one, and called new WebSocket().

Thanks!

puzrin commented 8 years ago

See example with faye in readme. You can replace faye with something else.

Each tab can create it's own connection, but only one is activated at once. Other tabs route messates master (tab with connection)

There are no SharedWorkers here.