aotrautils-srv 0.0.65 → 0.0.68

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-01:44:15)»*/
3
+ /*utils SERVER library associated with aotra version : «1.0.0.000 (13/07/2022-01:47:38)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -210,7 +210,7 @@ WebsocketImplementation={
210
210
 
211
211
 
212
212
  //
213
- // NODE SERVER
213
+ // NODE SERVER/CLIENT
214
214
  //
215
215
  getStatic:(isNodeContext=true, useSocketIOImplementation=false)=>{
216
216
 
@@ -219,21 +219,31 @@ WebsocketImplementation={
219
219
  // cf. https://socket.io/docs/v4/client-socket-instance/
220
220
  WebsocketImplementation.useSocketIOImplementation=useSocketIOImplementation;
221
221
 
222
- // OLD : socket.io :
223
- // https://stackoverflow.com/questions/31156884/how-to-use-https-on-node-js-using-express-socket-io
224
- // https://stackoverflow.com/questions/6599470/node-js-socket-io-with-ssl
225
- // https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener
226
-
227
- if(typeof(socketIO)==="undefined"){
222
+ if(WebsocketImplementation.useSocketIOImplementation){
223
+
228
224
  // TRACE
229
- console.log("«socket.io» SERVER library not called yet, calling it now.");
230
- socketIO=require("socket.io");
231
- return socketIO;
232
- }
233
- if(typeof(socketIO)==="undefined"){
225
+ lognow("INFO : (SERVER/CLIENT) Using socket.io websocket implementation.");
226
+
227
+ // OLD : socket.io :
228
+ // https://stackoverflow.com/questions/31156884/how-to-use-https-on-node-js-using-express-socket-io
229
+ // https://stackoverflow.com/questions/6599470/node-js-socket-io-with-ssl
230
+ // https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener
231
+
232
+ if(typeof(socketIO)==="undefined"){
233
+ // TRACE
234
+ console.log("«socket.io» SERVER library not called yet, calling it now.");
235
+ socketIO=require("socket.io");
236
+ return socketIO;
237
+ }
238
+ if(typeof(socketIO)==="undefined"){
239
+ // TRACE
240
+ console.log("ERROR : «socket.io» SERVER library not found. Cannot launch nodejs server. Aborting.");
241
+ return null;
242
+ }
243
+ }else{
234
244
  // TRACE
235
- console.log("ERROR : «socket.io» SERVER library not found. Cannot launch nodejs server. Aborting.");
236
- return null;
245
+ lognow("INFO : (SERVER/CLIENT) Using native websocket implementation.");
246
+
237
247
  }
238
248
 
239
249
  // *********************************************************************************
@@ -1301,7 +1311,7 @@ function getListManager(config){
1301
1311
 
1302
1312
 
1303
1313
 
1304
- /*utils COMMONS library associated with aotra version : «1.0.0.000 (13/07/2022-01:44:15)»*/
1314
+ /*utils COMMONS library associated with aotra version : «1.0.0.000 (13/07/2022-01:47:38)»*/
1305
1315
  /*-----------------------------------------------------------------------------*/
1306
1316
 
1307
1317
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.65",
3
+ "version": "0.0.68",
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)",