aotrautils-srv 0.0.75 → 0.0.76

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 SERVER library associated with aotra version : «1.0.0.000 (13/07/2022-02:22:17)»*/
3
+ /*utils SERVER library associated with aotra version : «1.0.0.000 (13/07/2022-02:25:54)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -286,13 +286,14 @@ WebsocketImplementation={
286
286
  serverSocket=new WebSocket.Server({ "server":listenableServer });
287
287
  }else{
288
288
 
289
-
289
+ const globalContext=(WebsocketImplementation.isNodeContext?global:window);
290
+
290
291
  // DBG
291
- console.log(">>>>>>>socketIO:",JSON.stringify(socketIO));
292
+ console.log(">>>>>>>socketIO:",JSON.stringify(globalContext.socketIO));
292
293
 
293
294
  // NOW : socket.io :
294
295
  // Loading socket.io
295
- serverSocket=socketIO.listen(listenableServer);
296
+ serverSocket=globalContext.socketIO.listen(listenableServer);
296
297
 
297
298
  // Setting up the disctonnect event :
298
299
  serverSocket.on("endConnection",()=>{
@@ -594,12 +595,15 @@ WebsocketImplementation={
594
595
  }else{
595
596
  // NOW : socket.io :
596
597
  //client on server-side:
597
- if(WebsocketImplementation.isNodeContext && typeof(socketIO)!=="undefined"){
598
+
599
+ const globalContext=(WebsocketImplementation.isNodeContext?global:window);
600
+
601
+ if(WebsocketImplementation.isNodeContext && typeof(globalContext.socketIO)!=="undefined"){
598
602
  // // Node client :
599
603
  // connectToServer=function (serverURL, port, isSecure, timeout=10000){
600
604
  // return socketIO.connect(serverURL + ":" + port,{timeout: timeout});
601
605
  // }
602
- clientSocket=socketIO.connect(serverURL + ":" + port,{timeout: timeout, secure: isSecure});
606
+ clientSocket=globalContext.socketIO.connect(serverURL + ":" + port,{timeout: timeout, secure: isSecure});
603
607
  }
604
608
  }
605
609
 
@@ -1318,7 +1322,7 @@ function getListManager(config){
1318
1322
 
1319
1323
 
1320
1324
 
1321
- /*utils COMMONS library associated with aotra version : «1.0.0.000 (13/07/2022-02:22:17)»*/
1325
+ /*utils COMMONS library associated with aotra version : «1.0.0.000 (13/07/2022-02:25:54)»*/
1322
1326
  /*-----------------------------------------------------------------------------*/
1323
1327
 
1324
1328
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.75",
3
+ "version": "0.0.76",
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)",