aotrautils 0.0.115 → 0.0.118
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 +27 -23
- 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:33:02)»*/
|
|
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:33:02)»*/
|
|
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:33:02)»*/
|
|
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:33:02)»*/
|
|
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,8 +13144,8 @@ WebsocketImplementation={
|
|
|
13144
13144
|
// *********************************************************************************
|
|
13145
13145
|
|
|
13146
13146
|
// DBG
|
|
13147
|
-
console.log("11111
|
|
13148
|
-
console.log("11111
|
|
13147
|
+
console.log("11111 Socket:",Socket);
|
|
13148
|
+
console.log("11111 WebSocket:",WebSocket);
|
|
13149
13149
|
|
|
13150
13150
|
|
|
13151
13151
|
|
|
@@ -13166,23 +13166,27 @@ WebsocketImplementation={
|
|
|
13166
13166
|
// NODE SERVER MODE ONLY :
|
|
13167
13167
|
let serverSocket;
|
|
13168
13168
|
if(!WebsocketImplementation.useSocketIOImplementation){
|
|
13169
|
-
serverSocket=new
|
|
13169
|
+
serverSocket=new WebSocket.Server({ "server":listenableServer });
|
|
13170
13170
|
}else{
|
|
13171
13171
|
|
|
13172
13172
|
|
|
13173
13173
|
// DBG
|
|
13174
|
-
console.log(">>>>>>>
|
|
13175
|
-
console.log(">>>>>>>
|
|
13174
|
+
console.log(">>>>>>>Socket:",Socket);
|
|
13175
|
+
console.log(">>>>>>>WebSocket:",WebSocket);
|
|
13176
13176
|
|
|
13177
13177
|
// NOW : socket.io :
|
|
13178
13178
|
// Loading socket.io
|
|
13179
|
-
serverSocket=
|
|
13179
|
+
serverSocket=new Socket(listenableServer);
|
|
13180
|
+
// OLD SYNTAX : serverSocket=Socket.listen(listenableServer);
|
|
13180
13181
|
|
|
13181
13182
|
// Setting up the disctonnect event :
|
|
13182
13183
|
serverSocket.on("endConnection",()=>{
|
|
13183
13184
|
serverSocket.disconnect();
|
|
13184
13185
|
});
|
|
13185
13186
|
|
|
13187
|
+
// ////
|
|
13188
|
+
// serverSocket.listen();
|
|
13189
|
+
|
|
13186
13190
|
}
|
|
13187
13191
|
|
|
13188
13192
|
// NODE SERVER INSTANCE :
|
|
@@ -13264,7 +13268,7 @@ WebsocketImplementation={
|
|
|
13264
13268
|
|
|
13265
13269
|
|
|
13266
13270
|
// TODO : FIXME : Use one single interface !
|
|
13267
|
-
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==
|
|
13271
|
+
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
|
|
13268
13272
|
else if(clientSocket.connected) return;
|
|
13269
13273
|
|
|
13270
13274
|
|
|
@@ -13288,7 +13292,7 @@ WebsocketImplementation={
|
|
|
13288
13292
|
|
|
13289
13293
|
// TODO : FIXME : Use one single interface !
|
|
13290
13294
|
let clientSocket=clientSocketParam;
|
|
13291
|
-
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==
|
|
13295
|
+
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
|
|
13292
13296
|
else if(clientSocket.connected) return;
|
|
13293
13297
|
|
|
13294
13298
|
|
|
@@ -13465,7 +13469,7 @@ WebsocketImplementation={
|
|
|
13465
13469
|
|
|
13466
13470
|
|
|
13467
13471
|
// NEW : ws :
|
|
13468
|
-
if(typeof(
|
|
13472
|
+
if(typeof(WebSocket)==="undefined"){
|
|
13469
13473
|
// TRACE
|
|
13470
13474
|
lognow("ERROR : CLIENT : Could not find websocket client lib, aborting client connection.");
|
|
13471
13475
|
return null;
|
|
@@ -13474,17 +13478,17 @@ WebsocketImplementation={
|
|
|
13474
13478
|
// NODE CLIENT MODE ONLY :
|
|
13475
13479
|
let clientSocket;
|
|
13476
13480
|
if(!WebsocketImplementation.useSocketIOImplementation){
|
|
13477
|
-
clientSocket=new
|
|
13481
|
+
clientSocket=new WebSocket(serverURL+":"+port,/*WORKAROUND:*/{ rejectUnauthorized:false, secure: isSecure });
|
|
13478
13482
|
}else{
|
|
13479
13483
|
// NOW : socket.io :
|
|
13480
13484
|
//client on server-side:
|
|
13481
13485
|
|
|
13482
|
-
if(WebsocketImplementation.isNodeContext && typeof(
|
|
13486
|
+
if(WebsocketImplementation.isNodeContext && typeof(Socket)!=="undefined"){
|
|
13483
13487
|
// // Node client :
|
|
13484
13488
|
// connectToServer=function (serverURL, port, isSecure, timeout=10000){
|
|
13485
|
-
// return
|
|
13489
|
+
// return Socket.connect(serverURL + ":" + port,{timeout: timeout});
|
|
13486
13490
|
// }
|
|
13487
|
-
clientSocket=
|
|
13491
|
+
clientSocket=Socket.connect(serverURL + ":" + port,{timeout: timeout, secure: isSecure});
|
|
13488
13492
|
}
|
|
13489
13493
|
}
|
|
13490
13494
|
|
|
@@ -13544,7 +13548,7 @@ WebsocketImplementation={
|
|
|
13544
13548
|
// console.log("(NODE CLIENT) TRYING TO SEND : clientSocket.readyState:",clientSocket.readyState);
|
|
13545
13549
|
|
|
13546
13550
|
// TODO : FIXME : Use one single interface !
|
|
13547
|
-
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==
|
|
13551
|
+
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
|
|
13548
13552
|
else if(clientSocket.connected) return;
|
|
13549
13553
|
|
|
13550
13554
|
|
|
@@ -13621,7 +13625,7 @@ WebsocketImplementation={
|
|
|
13621
13625
|
/*private*/connectToServerFromBrowser:(serverURL, port, isSecure, timeout)=>{
|
|
13622
13626
|
|
|
13623
13627
|
// NEW : ws :
|
|
13624
|
-
if(typeof(
|
|
13628
|
+
if(typeof(WebSocket)==="undefined"){
|
|
13625
13629
|
// TRACE
|
|
13626
13630
|
lognow("ERROR : CLIENT : Could not find websocket client lib, aborting client connection.");
|
|
13627
13631
|
return null;
|
|
@@ -13631,7 +13635,7 @@ WebsocketImplementation={
|
|
|
13631
13635
|
// BROWSER CLIENT MODE ONLY :
|
|
13632
13636
|
let clientSocket;
|
|
13633
13637
|
if(!WebsocketImplementation.useSocketIOImplementation){
|
|
13634
|
-
clientSocket=new
|
|
13638
|
+
clientSocket=new WebSocket(serverURL+":"+port,["ws","wss"]);
|
|
13635
13639
|
}else if(typeof(io)!=="undefined"){
|
|
13636
13640
|
// NOW : socket.io :
|
|
13637
13641
|
// // Browser client :
|
|
@@ -13697,7 +13701,7 @@ WebsocketImplementation={
|
|
|
13697
13701
|
// console.log("(BROWSER) TRYING TO SEND : clientSocket.readyState:",clientSocket.readyState);
|
|
13698
13702
|
|
|
13699
13703
|
// TODO : FIXME : Use one single interface !
|
|
13700
|
-
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==
|
|
13704
|
+
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
|
|
13701
13705
|
else if(clientSocket.connected) return;
|
|
13702
13706
|
|
|
13703
13707
|
|
aotrautils/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.118",
|
|
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)",
|