I need an idea in designing a complex html/javascript(jQuery) system communicating with my C++-Webserver.
Until now i have a main index.html and I load Submodules by events:
$(".MainButton").click(function(){
$("#swap").load($(this).attr('alt'));
});
The problem is now that every Submodule needs a Websocket Connection and I dont want to open a new Connection for every Submodule that I am loading.
Is it possible to open a global Websocket connection..
var ws = new WebSocket("ws://localhost:800/stream");
.. and use ws in every subpage?
Thank you very much.