sS hInitWebSocket(O... _) { optPar S wsVar = "ws"; optPar S onOpen; optPar S onMessage; optPar S readyMsg = "WebSocket ready!"; ret hreconnectingWebSockets() + hscript([[ var wsReady = false; var ]] + wsVar + [[ = new ReconnectingWebSocket(((window.location.protocol === "https:") ? "wss://" : "ws://") + window.location.host + "/"); ]] + wsVar + [[.onopen = function(event) { console.log(]] + jsQuote(readyMsg) + [[); ]] + unnull(onOpen) + [[ }; ]] + wsVar + [[.onmessage = function(event) { ]] + unnull(onMessage) + [[ }; ]]); }