aotrautils-srv 0.0.223 → 0.0.226

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.
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- /*utils COMMONS library associated with aotra version : «1_29072022-2359 (30/07/2022-00:00:12)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (30/07/2022-00:22:01)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4827,7 +4827,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4827
4827
 
4828
4828
 
4829
4829
 
4830
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (30/07/2022-00:00:12)»*/
4830
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (30/07/2022-00:22:01)»*/
4831
4831
  /*-----------------------------------------------------------------------------*/
4832
4832
 
4833
4833
 
@@ -5069,17 +5069,37 @@ WebsocketImplementation={
5069
5069
  lognow("INFO : (SERVER/CLIENT) Using socket.io websocket implementation.");
5070
5070
 
5071
5071
  if(isNodeContext){
5072
+
5073
+ // NODE SERVER :
5074
+ // DBG
5075
+ lognow("INFO : Loading NODE SERVER socket.io libraries.")
5072
5076
  if(typeof(Socket)==="undefined"){
5073
5077
  // TRACE
5074
- console.log("«socket.io» SERVER library not called yet, calling it now.");
5078
+ console.log("«socket.io» NODE SERVER library not called yet, calling it now.");
5075
5079
  Socket=require("socket.io");
5076
5080
  return WebsocketImplementation;
5077
5081
  }
5078
5082
  if(typeof(Socket)==="undefined"){
5079
5083
  // TRACE
5080
- console.log("ERROR : «socket.io» CONSOLE/BROWSER CLIENT/SERVER library not found. Cannot launch nodejs server. Aborting.");
5084
+ console.log("ERROR : «socket.io» NODE CLIENT/SERVER library not found. Cannot launch nodejs server. Aborting.");
5081
5085
  return WebsocketImplementation;
5082
5086
  }
5087
+
5088
+ // NODE CLIENT :
5089
+ // DBG
5090
+ lognow("INFO : Loading NODE CLIENT socket.io libraries.")
5091
+ if(typeof(io)==="undefined"){
5092
+ // TRACE
5093
+ console.log("«socket.io-client» NODE CLIENT library not called yet, calling it now.");
5094
+ io=require("socket.io-client");
5095
+ }
5096
+ if(typeof(io)==="undefined"){
5097
+ // TRACE
5098
+ console.log("ERROR : «socket-client.io» NODE CLIENT library not found. Cannot launch nodejs server. Aborting.");
5099
+ return WebsocketImplementation;
5100
+ }
5101
+
5102
+
5083
5103
  }
5084
5104
 
5085
5105
  }else{
@@ -5476,14 +5496,14 @@ WebsocketImplementation={
5476
5496
  // NOW : socket.io :
5477
5497
  //client on server-side:
5478
5498
 
5479
- if(WebsocketImplementation.isNodeContext && typeof(Socket)!=="undefined"){
5499
+ if(WebsocketImplementation.isNodeContext && typeof(io)!=="undefined"){
5480
5500
  // // Node client :
5481
5501
  // connectToServer=function (serverURL, port, isSecure, timeout=10000){
5482
5502
  // return Socket.connect(serverURL + ":" + port,{timeout: timeout});
5483
5503
  // }
5484
5504
 
5485
5505
  // OLD SYNTAX: clientSocket=Socket.connect(serverURL + ":" + port,{timeout: timeout, secure: isSecure});
5486
- // clientSocket=new Socket.Client???(serverURL + ":" + port,{timeout: timeout, secure: isSecure});
5506
+ // NO : clientSocket=new Socket.Client(serverURL + ":" + port,{timeout: timeout, secure: isSecure});
5487
5507
  clientSocket=io(serverURL + ":" + port,{timeout: timeout, secure: isSecure});
5488
5508
 
5489
5509
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.223",
3
+ "version": "0.0.226",
4
4
  "main": "aotrautils-srv.build.js",
5
5
  "description": "A library for vanilla javascript utils (server-side) used in aotra javascript CMS",
6
6
  "author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",
@@ -24,6 +24,7 @@
24
24
  "fs": "^0.0.1-security",
25
25
  "sjcl": "^1.0.8",
26
26
  "socket.io": "^4.5.1",
27
+ "socket.io-client": "^4.5.1",
27
28
  "ws": "^8.1.0"
28
29
  }
29
30
  }