tlsd 2.9.0 → 2.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/rpc_static/rpc/rpc.js
CHANGED
|
@@ -118,8 +118,9 @@
|
|
|
118
118
|
var socket = new WebSocket( ( loc.protocol == "http:" ? "ws:" : "wss:" ) + "//" + loc.host + path )
|
|
119
119
|
|
|
120
120
|
socket.onerror = function( evt ) {
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
evt.preventDefault();
|
|
122
|
+
DBG( "error:", evt );
|
|
123
|
+
cb_ctrl( "error", evt );
|
|
123
124
|
}
|
|
124
125
|
|
|
125
126
|
socket.onclose = function() {
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
document.write( Date() );
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
|
+
<div id=connect_status>?</div>
|
|
13
|
+
|
|
12
14
|
<script src="/rpc/rpc.js"></script>
|
|
13
15
|
|
|
14
16
|
<script>
|
|
@@ -32,9 +34,17 @@
|
|
|
32
34
|
|
|
33
35
|
RPC.on_connect = function( evt ) {
|
|
34
36
|
// RPC is ready to be used
|
|
35
|
-
RPC( { action: "hello" },
|
|
37
|
+
RPC( { action: "hello" }, msg => {
|
|
38
|
+
document.getElementById( "connect_status" ).innerText = msg;
|
|
39
|
+
} );
|
|
36
40
|
}
|
|
37
41
|
|
|
42
|
+
RPC.on_disconnect = function( evt ) {
|
|
43
|
+
// The websocket connection ws lost for some reason
|
|
44
|
+
// The RPC code will reconnect automatically
|
|
45
|
+
document.getElementById( "connect_status" ).innerText = "[ DISCONNECTED ]";
|
|
46
|
+
}
|
|
47
|
+
|
|
38
48
|
</script>
|
|
39
49
|
|
|
40
50
|
</body>
|