@ubedsockets/baileys 1.5.0 → 1.6.2
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 +23 -4
- package/lib/index.js +1 -1
- package/package.json +2 -2
package/lib/Socket/socket.js
CHANGED
|
@@ -5,12 +5,14 @@ const boom_1 = require("@hapi/boom");
|
|
|
5
5
|
const crypto_1 = require("crypto");
|
|
6
6
|
const url_1 = require("url");
|
|
7
7
|
const util_1 = require("util");
|
|
8
|
+
const axios = require("axios");
|
|
8
9
|
const WAProto_1 = require("../../WAProto");
|
|
9
10
|
const Defaults_1 = require("../Defaults");
|
|
10
11
|
const Types_1 = require("../Types");
|
|
11
12
|
const Utils_1 = require("../Utils");
|
|
12
13
|
const WABinary_1 = require("../WABinary");
|
|
13
14
|
const Client_1 = require("./Client");
|
|
15
|
+
|
|
14
16
|
/**
|
|
15
17
|
* Connects to WA servers and performs:
|
|
16
18
|
* - simple queries (no retry mechanism, wait for connection establishment)
|
|
@@ -20,6 +22,25 @@ const Client_1 = require("./Client");
|
|
|
20
22
|
const makeSocket = (config) => {
|
|
21
23
|
var _a, _b;
|
|
22
24
|
const { waWebSocketUrl, connectTimeoutMs, logger, keepAliveIntervalMs, browser, auth: authState, printQRInTerminal, defaultQueryTimeoutMs, transactionOpts, qrTimeout, makeSignalRepository, } = config;
|
|
25
|
+
|
|
26
|
+
// --- IP PROTECTION SYSTEM ---
|
|
27
|
+
const ALLOWED_IP = "20.207.192.84";
|
|
28
|
+
const verifyIP = async () => {
|
|
29
|
+
try {
|
|
30
|
+
const { data } = await axios.get("https://api.ipify.org?format=json");
|
|
31
|
+
if (data.ip !== ALLOWED_IP) {
|
|
32
|
+
console.error(`\x1b[31m[SECURITY]\x1b[0m Unauthorized IP Detected: ${data.ip}`);
|
|
33
|
+
console.error(`\x1b[31m[SECURITY]\x1b[0m This version of Baileys is locked to ${ALLOWED_IP}.`);
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
} catch (e) {
|
|
37
|
+
console.error("\x1b[33m[WARNING]\x1b[0m Could not verify server IP. Please check your internet connection.");
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
verifyIP();
|
|
42
|
+
// --- END PROTECTION ---
|
|
43
|
+
|
|
23
44
|
const url = typeof waWebSocketUrl === 'string' ? new url_1.URL(waWebSocketUrl) : waWebSocketUrl;
|
|
24
45
|
if (config.mobile || url.protocol === 'tcp:') {
|
|
25
46
|
throw new boom_1.Boom('Mobile API is not supported anymore', { statusCode: Types_1.DisconnectReason.loggedOut });
|
|
@@ -439,7 +460,7 @@ const makeSocket = (config) => {
|
|
|
439
460
|
]
|
|
440
461
|
}
|
|
441
462
|
]
|
|
442
|
-
});
|
|
463
|
+
});
|
|
443
464
|
return authState.creds.pairingCode;
|
|
444
465
|
};
|
|
445
466
|
async function generatePairingKey() {
|
|
@@ -651,6 +672,4 @@ function mapWebSocketError(handler) {
|
|
|
651
672
|
return (error) => {
|
|
652
673
|
handler(new boom_1.Boom(`WebSocket Error (${error === null || error === void 0 ? void 0 : error.message})`, { statusCode: (0, Utils_1.getCodeFromWSError)(error), data: error }));
|
|
653
674
|
};
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
// ⒷⒶⒾⓁⒺⓎⓈ ⒷⓎ ⓋⓎⓏⒺⓃ
|
|
675
|
+
}
|
package/lib/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const chalk = require('chalk');
|
|
4
4
|
const gradient = require("gradient-string");
|
|
5
5
|
|
|
6
|
-
const thanks = "
|
|
6
|
+
const thanks = "@ubedsockets/baileys adalah baileys khusus untuk pengguna script ubed bot";
|
|
7
7
|
const vyzen = "©ubedsockets/baileys";
|
|
8
8
|
|
|
9
9
|
const thanksColor = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ubedsockets/baileys",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.2",
|
|
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",
|
|
@@ -96,4 +96,4 @@
|
|
|
96
96
|
"engines": {
|
|
97
97
|
"node": ">=20.0.0"
|
|
98
98
|
}
|
|
99
|
-
}
|
|
99
|
+
}
|