--- a/svghmi/gen_index_xhtml.xslt Wed Jun 30 15:51:59 2021 +0200
+++ b/svghmi/gen_index_xhtml.xslt Thu Jul 01 14:33:14 2021 +0200
@@ -7556,7 +7556,19 @@
<xsl:text>// Open WebSocket to relative "/ws" address
- <xsl:text>var ws = new WebSocket(window.location.href.replace(/^http(s?:\/\/[^\/]*)\/.*$/, 'ws$1/ws'));
+ <xsl:text> window.location.href.replace(/^http(s?:\/\/[^\/]*)\/.*$/, 'ws$1/ws') + <xsl:text> + '?mode=' + (window.location.hash == "#watchdog" + <xsl:text> ? "watchdog" + <xsl:text> : "multiclient"); + <xsl:text>var ws = new WebSocket(ws_url); <xsl:text>ws.binaryType = 'arraybuffer';
--- a/svghmi/svghmi.js Wed Jun 30 15:51:59 2021 +0200
+++ b/svghmi/svghmi.js Thu Jul 01 14:33:14 2021 +0200
@@ -30,7 +30,13 @@
// Open WebSocket to relative "/ws" address
-var ws = new WebSocket(window.location.href.replace(/^http(s?:\/\/[^\/]*)\/.*$/, 'ws$1/ws'));
+ window.location.href.replace(/^http(s?:\/\/[^\/]*)\/.*$/, 'ws$1/ws') + + '?mode=' + (window.location.hash == "#watchdog" +var ws = new WebSocket(ws_url); ws.binaryType = 'arraybuffer';
--- a/svghmi/svghmi_server.py Wed Jun 30 15:51:59 2021 +0200
+++ b/svghmi/svghmi_server.py Thu Jul 01 14:33:14 2021 +0200
@@ -120,6 +120,10 @@
WebSocketServerProtocol.__init__(self, *args, **kwargs)
+ def onConnect(self, request): + self.has_watchdog = request.params.get("mode", [None])[0] == "watchdog" + return WebSocketServerProtocol.onConnect(self, request) assert(self._hmi_session is None)
self._hmi_session = HMISession(self)