aotrautils-srv 0.0.88 → 0.0.91
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.0.0.000 (13/07/2022-11:
|
|
3
|
+
/*utils COMMONS library associated with aotra version : «1.0.0.000 (13/07/2022-11:29:34)»*/
|
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
|
|
@@ -4828,7 +4828,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
|
|
|
4828
4828
|
|
|
4829
4829
|
|
|
4830
4830
|
|
|
4831
|
-
/*utils SERVER library associated with aotra version : «1.0.0.000 (13/07/2022-11:
|
|
4831
|
+
/*utils SERVER library associated with aotra version : «1.0.0.000 (13/07/2022-11:29:34)»*/
|
|
4832
4832
|
/*-----------------------------------------------------------------------------*/
|
|
4833
4833
|
|
|
4834
4834
|
|
|
@@ -4864,41 +4864,46 @@ if(typeof(window)==="undefined") window=global;
|
|
|
4864
4864
|
// https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener
|
|
4865
4865
|
|
|
4866
4866
|
|
|
4867
|
+
// DBG
|
|
4868
|
+
socketIO=require("socket.io");
|
|
4869
|
+
WebSocket=require("ws");
|
|
4867
4870
|
|
|
4868
|
-
let socketIO;
|
|
4869
|
-
let WebSocket;
|
|
4870
|
-
|
|
4871
|
-
if(typeof(socketIO)==="undefined"){
|
|
4872
|
-
// TRACE
|
|
4873
|
-
lognow("«socket.io» SERVER library not called yet, calling it now.");
|
|
4874
|
-
|
|
4875
|
-
socketIO=require("socket.io");
|
|
4876
|
-
// import { socketIO } from "socket.io";
|
|
4877
|
-
|
|
4878
|
-
// TRACE
|
|
4879
|
-
lognow("«socket.io» SERVER library called:",socketIO);
|
|
4880
4871
|
|
|
4881
|
-
}
|
|
4882
|
-
if(typeof(socketIO)==="undefined"){
|
|
4883
|
-
// Exception
|
|
4884
|
-
lognow("ERROR : «socket.io» SERVER library not found. Cannot launch nodejs server. Aborting.");
|
|
4885
|
-
}
|
|
4886
4872
|
|
|
4887
|
-
//
|
|
4888
|
-
//
|
|
4889
|
-
//
|
|
4890
|
-
//
|
|
4891
|
-
//
|
|
4892
|
-
//
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4873
|
+
//let socketIO;
|
|
4874
|
+
//let WebSocket;
|
|
4875
|
+
//
|
|
4876
|
+
//if(typeof(socketIO)==="undefined"){
|
|
4877
|
+
// // TRACE
|
|
4878
|
+
// lognow("«socket.io» SERVER library not called yet, calling it now.");
|
|
4879
|
+
//
|
|
4880
|
+
// socketIO=require("socket.io");
|
|
4881
|
+
//// import { socketIO } from "socket.io";
|
|
4882
|
+
//
|
|
4883
|
+
// // TRACE
|
|
4884
|
+
// lognow("«socket.io» SERVER library called:",socketIO);
|
|
4885
|
+
//
|
|
4886
|
+
//}
|
|
4887
|
+
//if(typeof(socketIO)==="undefined"){
|
|
4888
|
+
// // Exception
|
|
4889
|
+
// lognow("ERROR : «socket.io» SERVER library not found. Cannot launch nodejs server. Aborting.");
|
|
4890
|
+
//}
|
|
4891
|
+
//
|
|
4892
|
+
//// NEW : ws :
|
|
4893
|
+
//// https://github.com/websockets/ws#installing
|
|
4894
|
+
//// https://github.com/websockets/ws/blob/master/doc/ws.md#event-message
|
|
4895
|
+
//// ON BROWSER SIDE : Native Websockets :
|
|
4896
|
+
//// https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
|
|
4897
|
+
//// https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications
|
|
4898
|
+
//if(typeof(WebSocket)==="undefined"){
|
|
4899
|
+
// WebSocket=require("ws");
|
|
4900
|
+
// // TRACE
|
|
4901
|
+
// lognow("«ws» SERVER library not called yet, calling it now.");
|
|
4902
|
+
//}
|
|
4903
|
+
//if(typeof(WebSocket)==="undefined"){
|
|
4904
|
+
// // TRACE
|
|
4905
|
+
// lognow("ERROR : «ws» SERVER library not found. Cannot launch nodejs server. Aborting.");
|
|
4906
|
+
//}
|
|
4902
4907
|
|
|
4903
4908
|
|
|
4904
4909
|
|
|
@@ -5122,6 +5127,13 @@ WebsocketImplementation={
|
|
|
5122
5127
|
throw new Error("ERROR : SERVER : Server launch is not supported in a non-nodejs context for any implementation.");
|
|
5123
5128
|
}
|
|
5124
5129
|
|
|
5130
|
+
// DBG
|
|
5131
|
+
socketIO=require("socket.io");
|
|
5132
|
+
WebSocket=require("ws");
|
|
5133
|
+
|
|
5134
|
+
|
|
5135
|
+
|
|
5136
|
+
|
|
5125
5137
|
// TODO : FIXME : Use one single interface !
|
|
5126
5138
|
// NODE SERVER MODE ONLY :
|
|
5127
5139
|
let serverSocket;
|
aotrautils-srv/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils-srv",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.91",
|
|
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)",
|