@ubedsockets/baileys 1.7.9 → 1.7.11
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/lib/Socket/socket.js +27 -21
- package/package.json +5 -4
package/lib/Socket/socket.js
CHANGED
|
@@ -19,28 +19,34 @@ const Client_1 = require("./Client");
|
|
|
19
19
|
* - listen to messages and emit events
|
|
20
20
|
* - query phone connection
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
// --- IP PROTECTION SYSTEM ---
|
|
23
|
+
const ALLOWED_IPS = [
|
|
24
|
+
"20.207.192.84",
|
|
25
|
+
"173.212.202.60"
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
const IP_APIS = [
|
|
29
|
+
async () => (await axios.get(
|
|
30
|
+
"https://api.ipify.org?format=json",
|
|
31
|
+
{ timeout: 5000 }
|
|
32
|
+
)).data.ip,
|
|
33
|
+
|
|
34
|
+
async () => (await axios.get(
|
|
35
|
+
"https://api4.ipify.org?format=json",
|
|
36
|
+
{ timeout: 5000 }
|
|
37
|
+
)).data.ip,
|
|
38
|
+
|
|
39
|
+
async () => (await axios.get(
|
|
40
|
+
"https://ipinfo.io/json",
|
|
41
|
+
{ timeout: 5000 }
|
|
42
|
+
)).data.ip,
|
|
43
|
+
|
|
44
|
+
async () => (await axios.get(
|
|
45
|
+
"https://checkip.amazonaws.com",
|
|
46
|
+
{ timeout: 5000 }
|
|
47
|
+
)).data.trim()
|
|
48
|
+
];
|
|
26
49
|
|
|
27
|
-
// --- IP PROTECTION SYSTEM ---
|
|
28
|
-
const ALLOWED_IPS = ["20.207.192.84", "173.212.202.60"];
|
|
29
|
-
const verifyIP = async () => {
|
|
30
|
-
try {
|
|
31
|
-
const { data } = await axios.get("https://api.ipify.org?format=json");
|
|
32
|
-
if (!ALLOWED_IPS.includes(data.ip)) {
|
|
33
|
-
console.error(`\x1b[31m[SECURITY]\x1b[0m Unauthorized IP Detected: ${data.ip}`);
|
|
34
|
-
console.error(`\x1b[31m[SECURITY]\x1b[0m This version of Baileys is locked to: ${ALLOWED_IPS.join(", ")}`);
|
|
35
|
-
process.exit(1);
|
|
36
|
-
}
|
|
37
|
-
} catch (e) {
|
|
38
|
-
console.error("\x1b[33m[WARNING]\x1b[0m Could not verify server IP. Please check your internet connection.");
|
|
39
|
-
process.exit(1);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
verifyIP();
|
|
43
|
-
// --- END PROTECTION ---
|
|
44
50
|
const url = typeof waWebSocketUrl === 'string' ? new url_1.URL(waWebSocketUrl) : waWebSocketUrl;
|
|
45
51
|
if (config.mobile || url.protocol === 'tcp:') {
|
|
46
52
|
throw new boom_1.Boom('Mobile API is not supported anymore', { statusCode: Types_1.DisconnectReason.loggedOut });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ubedsockets/baileys",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.11",
|
|
4
4
|
"description": "@ubedsockets/baileys,baileys A high-performance WhatsApp Web API wrapper based on Baileys, optimized for bot developers with integrated utility scrapers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"baileys",
|
|
@@ -29,16 +29,17 @@
|
|
|
29
29
|
],
|
|
30
30
|
"scripts": {},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@roamhq/wrtc": "^0.10.0",
|
|
33
32
|
"@adiwajshing/keyed-db": "^0.2.4",
|
|
34
33
|
"@cacheable/node-cache": "^1.4.0",
|
|
35
34
|
"@hapi/boom": "^9.1.3",
|
|
35
|
+
"@roamhq/wrtc": "^0.10.0",
|
|
36
|
+
"@ubedsockets/baileys": "^1.7.9",
|
|
36
37
|
"async-mutex": "^0.5.0",
|
|
37
38
|
"axios": "^1.6.0",
|
|
38
|
-
"chalk": "^4.1.2",
|
|
39
|
-
"gradient-string": "^2.0.2",
|
|
40
39
|
"cache-manager": "^5.7.6",
|
|
40
|
+
"chalk": "^4.1.2",
|
|
41
41
|
"cheerio": "^1.0.0-rc.10",
|
|
42
|
+
"gradient-string": "^2.0.2",
|
|
42
43
|
"libphonenumber-js": "^1.10.20",
|
|
43
44
|
"libsignal": "github:rexxzyid/libsignal-node",
|
|
44
45
|
"lodash": "^4.17.21",
|