aotrautils 0.0.114 → 0.0.117
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.
- aotrautils/aotrautils.build.js +24 -25
- aotrautils/package.json +1 -1
aotrautils/aotrautils.build.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
/*utils COMMONS library associated with aotra version : «1.0.0.000 (16/07/2022-15:
|
|
3
|
+
/*utils COMMONS library associated with aotra version : «1.0.0.000 (16/07/2022-15:19:18)»*/
|
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
|
|
@@ -4828,7 +4828,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
|
|
|
4828
4828
|
|
|
4829
4829
|
|
|
4830
4830
|
|
|
4831
|
-
/*utils CLIENT library associated with aotra version : «1.0.0.000 (16/07/2022-15:
|
|
4831
|
+
/*utils CLIENT library associated with aotra version : «1.0.0.000 (16/07/2022-15:19:18)»*/
|
|
4832
4832
|
/*-----------------------------------------------------------------------------*/
|
|
4833
4833
|
/* ## Utility global methods in a browser (htmljs) client environment.
|
|
4834
4834
|
*
|
|
@@ -11678,7 +11678,7 @@ createFusrodaClient=function(doOnClientReady, doOnDataReception, urlParam=null,
|
|
|
11678
11678
|
|
|
11679
11679
|
|
|
11680
11680
|
|
|
11681
|
-
/*utils GEOMETRY library associated with aotra version : «1.0.0.000 (16/07/2022-15:
|
|
11681
|
+
/*utils GEOMETRY library associated with aotra version : «1.0.0.000 (16/07/2022-15:19:18)»*/
|
|
11682
11682
|
/*-----------------------------------------------------------------------------*/
|
|
11683
11683
|
|
|
11684
11684
|
|
|
@@ -12884,7 +12884,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
|
|
|
12884
12884
|
// MUST REMAIN AT THE END OF THIS LIBRARY FILE !
|
|
12885
12885
|
|
|
12886
12886
|
AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
|
|
12887
|
-
/*utils SERVER library associated with aotra version : «1.0.0.000 (16/07/2022-15:
|
|
12887
|
+
/*utils SERVER library associated with aotra version : «1.0.0.000 (16/07/2022-15:19:18)»*/
|
|
12888
12888
|
/*-----------------------------------------------------------------------------*/
|
|
12889
12889
|
|
|
12890
12890
|
|
|
@@ -13109,8 +13109,8 @@ if(typeof(fs)==="undefined"){
|
|
|
13109
13109
|
// NODE ONLY SERVER / CLIENTS :
|
|
13110
13110
|
WebsocketImplementation={
|
|
13111
13111
|
|
|
13112
|
-
|
|
13113
|
-
|
|
13112
|
+
// Socket:Socket,
|
|
13113
|
+
// WebSocket:WebSocket,
|
|
13114
13114
|
|
|
13115
13115
|
isNodeContext:true,
|
|
13116
13116
|
useSocketIOImplementation:false,
|
|
@@ -13144,10 +13144,9 @@ WebsocketImplementation={
|
|
|
13144
13144
|
// *********************************************************************************
|
|
13145
13145
|
|
|
13146
13146
|
// DBG
|
|
13147
|
-
console.log("11111
|
|
13148
|
-
console.log("11111
|
|
13149
|
-
|
|
13150
|
-
console.log("11111 WebsocketImplementation.WebSocket:",JSON.stringify(WebsocketImplementation.WebSocket));
|
|
13147
|
+
console.log("11111 Socket:",Socket);
|
|
13148
|
+
console.log("11111 WebSocket:",WebSocket);
|
|
13149
|
+
|
|
13151
13150
|
|
|
13152
13151
|
|
|
13153
13152
|
return WebsocketImplementation;
|
|
@@ -13167,17 +13166,17 @@ WebsocketImplementation={
|
|
|
13167
13166
|
// NODE SERVER MODE ONLY :
|
|
13168
13167
|
let serverSocket;
|
|
13169
13168
|
if(!WebsocketImplementation.useSocketIOImplementation){
|
|
13170
|
-
serverSocket=new
|
|
13169
|
+
serverSocket=new WebSocket.Server({ "server":listenableServer });
|
|
13171
13170
|
}else{
|
|
13172
13171
|
|
|
13173
13172
|
|
|
13174
13173
|
// DBG
|
|
13175
|
-
console.log(">>>>>>>
|
|
13176
|
-
console.log(">>>>>>>
|
|
13174
|
+
console.log(">>>>>>>Socket:",Socket);
|
|
13175
|
+
console.log(">>>>>>>WebSocket:",WebSocket);
|
|
13177
13176
|
|
|
13178
13177
|
// NOW : socket.io :
|
|
13179
13178
|
// Loading socket.io
|
|
13180
|
-
serverSocket=
|
|
13179
|
+
serverSocket=Socket.listen(listenableServer);
|
|
13181
13180
|
|
|
13182
13181
|
// Setting up the disctonnect event :
|
|
13183
13182
|
serverSocket.on("endConnection",()=>{
|
|
@@ -13265,7 +13264,7 @@ WebsocketImplementation={
|
|
|
13265
13264
|
|
|
13266
13265
|
|
|
13267
13266
|
// TODO : FIXME : Use one single interface !
|
|
13268
|
-
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==
|
|
13267
|
+
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
|
|
13269
13268
|
else if(clientSocket.connected) return;
|
|
13270
13269
|
|
|
13271
13270
|
|
|
@@ -13289,7 +13288,7 @@ WebsocketImplementation={
|
|
|
13289
13288
|
|
|
13290
13289
|
// TODO : FIXME : Use one single interface !
|
|
13291
13290
|
let clientSocket=clientSocketParam;
|
|
13292
|
-
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==
|
|
13291
|
+
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
|
|
13293
13292
|
else if(clientSocket.connected) return;
|
|
13294
13293
|
|
|
13295
13294
|
|
|
@@ -13466,7 +13465,7 @@ WebsocketImplementation={
|
|
|
13466
13465
|
|
|
13467
13466
|
|
|
13468
13467
|
// NEW : ws :
|
|
13469
|
-
if(typeof(
|
|
13468
|
+
if(typeof(WebSocket)==="undefined"){
|
|
13470
13469
|
// TRACE
|
|
13471
13470
|
lognow("ERROR : CLIENT : Could not find websocket client lib, aborting client connection.");
|
|
13472
13471
|
return null;
|
|
@@ -13475,17 +13474,17 @@ WebsocketImplementation={
|
|
|
13475
13474
|
// NODE CLIENT MODE ONLY :
|
|
13476
13475
|
let clientSocket;
|
|
13477
13476
|
if(!WebsocketImplementation.useSocketIOImplementation){
|
|
13478
|
-
clientSocket=new
|
|
13477
|
+
clientSocket=new WebSocket(serverURL+":"+port,/*WORKAROUND:*/{ rejectUnauthorized:false, secure: isSecure });
|
|
13479
13478
|
}else{
|
|
13480
13479
|
// NOW : socket.io :
|
|
13481
13480
|
//client on server-side:
|
|
13482
13481
|
|
|
13483
|
-
if(WebsocketImplementation.isNodeContext && typeof(
|
|
13482
|
+
if(WebsocketImplementation.isNodeContext && typeof(Socket)!=="undefined"){
|
|
13484
13483
|
// // Node client :
|
|
13485
13484
|
// connectToServer=function (serverURL, port, isSecure, timeout=10000){
|
|
13486
|
-
// return
|
|
13485
|
+
// return Socket.connect(serverURL + ":" + port,{timeout: timeout});
|
|
13487
13486
|
// }
|
|
13488
|
-
clientSocket=
|
|
13487
|
+
clientSocket=Socket.connect(serverURL + ":" + port,{timeout: timeout, secure: isSecure});
|
|
13489
13488
|
}
|
|
13490
13489
|
}
|
|
13491
13490
|
|
|
@@ -13545,7 +13544,7 @@ WebsocketImplementation={
|
|
|
13545
13544
|
// console.log("(NODE CLIENT) TRYING TO SEND : clientSocket.readyState:",clientSocket.readyState);
|
|
13546
13545
|
|
|
13547
13546
|
// TODO : FIXME : Use one single interface !
|
|
13548
|
-
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==
|
|
13547
|
+
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
|
|
13549
13548
|
else if(clientSocket.connected) return;
|
|
13550
13549
|
|
|
13551
13550
|
|
|
@@ -13622,7 +13621,7 @@ WebsocketImplementation={
|
|
|
13622
13621
|
/*private*/connectToServerFromBrowser:(serverURL, port, isSecure, timeout)=>{
|
|
13623
13622
|
|
|
13624
13623
|
// NEW : ws :
|
|
13625
|
-
if(typeof(
|
|
13624
|
+
if(typeof(WebSocket)==="undefined"){
|
|
13626
13625
|
// TRACE
|
|
13627
13626
|
lognow("ERROR : CLIENT : Could not find websocket client lib, aborting client connection.");
|
|
13628
13627
|
return null;
|
|
@@ -13632,7 +13631,7 @@ WebsocketImplementation={
|
|
|
13632
13631
|
// BROWSER CLIENT MODE ONLY :
|
|
13633
13632
|
let clientSocket;
|
|
13634
13633
|
if(!WebsocketImplementation.useSocketIOImplementation){
|
|
13635
|
-
clientSocket=new
|
|
13634
|
+
clientSocket=new WebSocket(serverURL+":"+port,["ws","wss"]);
|
|
13636
13635
|
}else if(typeof(io)!=="undefined"){
|
|
13637
13636
|
// NOW : socket.io :
|
|
13638
13637
|
// // Browser client :
|
|
@@ -13698,7 +13697,7 @@ WebsocketImplementation={
|
|
|
13698
13697
|
// console.log("(BROWSER) TRYING TO SEND : clientSocket.readyState:",clientSocket.readyState);
|
|
13699
13698
|
|
|
13700
13699
|
// TODO : FIXME : Use one single interface !
|
|
13701
|
-
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==
|
|
13700
|
+
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
|
|
13702
13701
|
else if(clientSocket.connected) return;
|
|
13703
13702
|
|
|
13704
13703
|
|
aotrautils/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.117",
|
|
4
4
|
"main": "aotrautils.build.js",
|
|
5
5
|
"description": "A library for vanilla javascript utils (client-side) used in aotra javascript CMS",
|
|
6
6
|
"author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",
|