i'm looking for nice tutorial or, maybe, some tips how to implements web sockets in multi-page web project.
For example i have welcome page and some link here. When i press on link i should be redirected to www.domainname.com/anypath with another fields and data.
To interact with the server i need to use web-socets. How many Server and client endpoint i should create? New endpoint for each page, or only 1 endpoint for each page?
I'm really trying to research it in google but there only tutorials with one page without any user navigation.
in simple realisation you create a websocket connection per each page, but if want optimize your application possible create one connect per all tabs.
for this optimize your can see how this realized in my open source comet server in file CometServerApi.js
In two words in file CometServerApi.js establishing a one connection to server from first opened tab ( i call this master tab
), and other tabs send and receive message through master tab
For communications between tab i use event onstorage
emerging on all tabs when i write any data to localstorage in any tab.