tlsd 2.4.0 → 2.4.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tlsd",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "A server for web app prototyping with HTTPS and Websockets",
5
5
  "main": "tlsd.js",
6
6
  "bin": {
@@ -6,13 +6,13 @@
6
6
  // Send msg via Websocket if it's less than around 5K stringified, otherwise use POST
7
7
  RPC( msg_object, okay, fail );
8
8
 
9
- RPC.on_connect = () => {
9
+ RPC.connect( function() {
10
10
  RPC( { action: "Hello, I'm a client" }, rsp => {
11
11
  console.log( rsp ) // "Welcome client, I'm a server"
12
12
  }, error => {
13
13
  alert( error )
14
14
  } );
15
- };
15
+ } );
16
16
 
17
17
  RPC.debug = true; // enable on console debug output
18
18
 
@@ -216,7 +216,7 @@
216
216
  };
217
217
 
218
218
  const connect = function( cb ) {
219
- if( connected ) {
219
+ if( RPC.connected ) {
220
220
  cb();
221
221
  } else {
222
222
  RPC.on_connect = cb;
@@ -5,7 +5,7 @@
5
5
 
6
6
  <script>
7
7
  RPC.debug = true;
8
- RPC.on_connect = evt => {
8
+ RPC.connect( function() {
9
9
  RPC( { action: "ping" }, console.log, alert );
10
- };
10
+ } );
11
11
  </script>