topbit 1.0.0 → 3.0.0
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/LICENSE +128 -0
- package/README.cn.md +1519 -0
- package/README.md +1483 -0
- package/bin/app.js +17 -0
- package/bin/loadinfo.sh +18 -0
- package/bin/new-ctl.js +234 -0
- package/bin/newapp.js +22 -0
- package/demo/allow.js +98 -0
- package/demo/cert/localhost-cert.pem +19 -0
- package/demo/cert/localhost-privkey.pem +28 -0
- package/demo/controller/api.js +15 -0
- package/demo/extends.js +5 -0
- package/demo/group-api.js +161 -0
- package/demo/group-api2.js +109 -0
- package/demo/http2.js +34 -0
- package/demo/http2_proxy_backend.js +45 -0
- package/demo/http2proxy.js +48 -0
- package/demo/http_proxy_backend.js +44 -0
- package/demo/httpproxy.js +47 -0
- package/demo/loader.js +27 -0
- package/demo/log.js +118 -0
- package/demo/memlimit.js +31 -0
- package/demo/min.js +7 -0
- package/demo/serv.js +15 -0
- package/images/middleware.jpg +0 -0
- package/images/topbit-middleware.png +0 -0
- package/images/topbit.png +0 -0
- package/package.json +42 -11
- package/src/_loadExtends.js +21 -0
- package/src/bodyparser.js +420 -0
- package/src/connfilter.js +125 -0
- package/src/context1.js +166 -0
- package/src/context2.js +182 -0
- package/src/ctxpool.js +39 -0
- package/src/ext.js +318 -0
- package/src/extends/Http2Pool.js +365 -0
- package/src/extends/__randstring.js +24 -0
- package/src/extends/cookie.js +44 -0
- package/src/extends/cors.js +334 -0
- package/src/extends/errorlog.js +252 -0
- package/src/extends/http2limit.js +126 -0
- package/src/extends/http2proxy.js +691 -0
- package/src/extends/jwt.js +217 -0
- package/src/extends/mixlogger.js +63 -0
- package/src/extends/paramcheck.js +266 -0
- package/src/extends/proxy.js +662 -0
- package/src/extends/realip.js +34 -0
- package/src/extends/referer.js +68 -0
- package/src/extends/resource.js +398 -0
- package/src/extends/session.js +174 -0
- package/src/extends/setfinal.js +50 -0
- package/src/extends/sni.js +48 -0
- package/src/extends/sse.js +293 -0
- package/src/extends/timing.js +111 -0
- package/src/extends/tofile.js +123 -0
- package/src/fastParseUrl.js +426 -0
- package/src/headerLimit.js +18 -0
- package/src/http1.js +336 -0
- package/src/http2.js +337 -0
- package/src/httpc.js +251 -0
- package/src/lib/npargv.js +354 -0
- package/src/lib/zipdata.js +45 -0
- package/src/loader/loader.js +999 -0
- package/src/logger.js +32 -0
- package/src/loggermsg.js +349 -0
- package/src/makeId.js +200 -0
- package/src/midcore.js +213 -0
- package/src/middleware1.js +103 -0
- package/src/middleware2.js +116 -0
- package/src/monitor.js +380 -0
- package/src/movefile.js +30 -0
- package/src/optionsCheck.js +54 -0
- package/src/randstring.js +23 -0
- package/src/router.js +682 -0
- package/src/sendmsg.js +27 -0
- package/src/strong.js +72 -0
- package/src/token/token.js +461 -0
- package/src/topbit.js +1293 -0
- package/src/versionCheck.js +31 -0
- package/test/test-bigctx.js +29 -0
- package/test/test-daemon-args.js +7 -0
- package/test/test-ext.js +81 -0
- package/test/test-find.js +69 -0
- package/test/test-route-sort.js +71 -0
- package/test/test-route.js +49 -0
- package/test/test-route2.js +51 -0
- package/test/test-run-args.js +7 -0
- package/test/test-url.js +52 -0
- package/main.js +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const process = require('node:process')
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 仅支持14.18以上版本。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
let _err_info = '请使用Node.js v14.18 以上版本。(Please use Node.js v14.18+)'
|
|
10
|
+
|
|
11
|
+
module.exports = function (minVersion = 14) {
|
|
12
|
+
try {
|
|
13
|
+
let cur = parseInt(process.version.substring(1))
|
|
14
|
+
|
|
15
|
+
if (cur < minVersion) return {
|
|
16
|
+
stat: false,
|
|
17
|
+
errmsg: _err_info
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
stat: true,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
} catch (err) {
|
|
25
|
+
//不要因为小错误导致不能启动。
|
|
26
|
+
return {
|
|
27
|
+
stat: true,
|
|
28
|
+
errmsg: err.message
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const titbit = require('../lib/titbit.js');
|
|
2
|
+
|
|
3
|
+
var app = new titbit({
|
|
4
|
+
debug: true,
|
|
5
|
+
//http2: true
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
var start_time = Date.now();
|
|
9
|
+
|
|
10
|
+
var ctx = null;
|
|
11
|
+
|
|
12
|
+
let total = 20000;
|
|
13
|
+
|
|
14
|
+
for (let i=0 ;i < total; i++) {
|
|
15
|
+
ctx = new app.httpServ.Context();
|
|
16
|
+
ctx.path = '/';
|
|
17
|
+
ctx.ip = '127.0.0.1';
|
|
18
|
+
ctx.requestCall = (c) => {
|
|
19
|
+
c.send('success');
|
|
20
|
+
};
|
|
21
|
+
ctx.box.rand = Math.random()
|
|
22
|
+
ctx = null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var end_time = Date.now();
|
|
26
|
+
|
|
27
|
+
let rtm = end_time - start_time;
|
|
28
|
+
|
|
29
|
+
console.log(rtm, 'ms', `${parseInt(total * 1000 / rtm)}/s`);
|
package/test/test-ext.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const helper = require('../src/ext.js')
|
|
4
|
+
|
|
5
|
+
let key = '123456789012345678900987654321qw'
|
|
6
|
+
|
|
7
|
+
let data = JSON.stringify({
|
|
8
|
+
name : '简单的机械键盘',
|
|
9
|
+
age : 30
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
helper.aesIv = 'qwertyuiopasdfgh'
|
|
13
|
+
|
|
14
|
+
let cryptData = helper.aesEncrypt(data, key)
|
|
15
|
+
|
|
16
|
+
console.log('encrypt data:', cryptData)
|
|
17
|
+
|
|
18
|
+
console.log('aes decrypt: ', helper.aesDecrypt(cryptData, key))
|
|
19
|
+
|
|
20
|
+
helper.aesIv = '1010101010101010';
|
|
21
|
+
|
|
22
|
+
console.log('aesIv: ', helper.aesIv);
|
|
23
|
+
|
|
24
|
+
console.log('timestr: ', helper.timestr() )
|
|
25
|
+
|
|
26
|
+
console.log('make name: ', helper.makeName('aswe.jpg'))
|
|
27
|
+
|
|
28
|
+
console.log('make name: ', helper.makeName('qw123456..'))
|
|
29
|
+
|
|
30
|
+
console.log('make name: ', helper.makeName('qw123456.'))
|
|
31
|
+
|
|
32
|
+
console.log('make name: ', helper.makeName('qwert..jpe.zip'))
|
|
33
|
+
|
|
34
|
+
console.log(helper.ctype('.jppe'))
|
|
35
|
+
|
|
36
|
+
console.log(helper.ctype('.jpg'))
|
|
37
|
+
|
|
38
|
+
console.log(helper.ctype('.js'))
|
|
39
|
+
|
|
40
|
+
console.log('hmacsha1: ', helper.hmacsha1('12345', '123456', 'base64'))
|
|
41
|
+
|
|
42
|
+
console.log('sm3: ', helper.sm3(`${Date.now()}`))
|
|
43
|
+
|
|
44
|
+
for (let i = 0; i < 5; i++) {
|
|
45
|
+
console.log( helper.nrand(i, 1000 - i) )
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
for (let i = 0; i < 10 ; i++) {
|
|
49
|
+
console.log(helper.serialId(), helper.uuid() )
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
for (let i = 0; i < 10 ; i++) {
|
|
53
|
+
console.log( helper.uuid(true) )
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
let st = Date.now()
|
|
57
|
+
|
|
58
|
+
let uuidmap = {}
|
|
59
|
+
let tmp
|
|
60
|
+
|
|
61
|
+
let output_count = 0
|
|
62
|
+
|
|
63
|
+
let crashcount = 0
|
|
64
|
+
|
|
65
|
+
for (let i = 0; i < 1200000; i++) {
|
|
66
|
+
tmp = helper.uuid()
|
|
67
|
+
//tmp = helper.serialId(16)
|
|
68
|
+
if (uuidmap[tmp] === undefined) {
|
|
69
|
+
if (output_count < 10) {
|
|
70
|
+
console.log(tmp)
|
|
71
|
+
output_count += 1
|
|
72
|
+
}
|
|
73
|
+
uuidmap[tmp] = 1
|
|
74
|
+
} else {
|
|
75
|
+
crashcount += 1
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
let et = Date.now()
|
|
80
|
+
|
|
81
|
+
console.log(et - st, 'ms', crashcount)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
const doio = require('../lib/titbit.js');
|
|
2
|
+
|
|
3
|
+
const app = new doio();
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
app.get('/:name/:', async c => {});
|
|
7
|
+
} catch (err) {
|
|
8
|
+
console.error(err.message);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
try {
|
|
12
|
+
app.get('/:content/*', async c => {});
|
|
13
|
+
} catch (err) {
|
|
14
|
+
console.error(err.message);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
app.get('/x/*/y', async c => {});
|
|
19
|
+
} catch (err) {
|
|
20
|
+
console.error(err.message);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
app.get('/p/:name/:id/:age/::', async c => {});
|
|
24
|
+
|
|
25
|
+
try {
|
|
26
|
+
console.log('测试 模式冲突 路由添加...')
|
|
27
|
+
app.get('/p/:x/:y/:z/:k', async c => {})
|
|
28
|
+
} catch (err) {}
|
|
29
|
+
|
|
30
|
+
app.get('/static/*', async c => {});
|
|
31
|
+
|
|
32
|
+
app.get('/file/download/*', async c => {});
|
|
33
|
+
|
|
34
|
+
app.get('/:sys/:release/iso/:handle', async c => {});
|
|
35
|
+
|
|
36
|
+
app.get('/xyz', async c => {});
|
|
37
|
+
|
|
38
|
+
app.get('/xyz/:key/oop/:oop', async c => {});
|
|
39
|
+
app.get('/xyz/:key/oo/:oop', async c => {});
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
console.log('---测试非法路由字符串---')
|
|
43
|
+
app.get('/^*', async c => {})
|
|
44
|
+
} catch (err) {
|
|
45
|
+
console.log(err.message)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
let test_arr = [
|
|
49
|
+
['/p/wang/1/25/:', 'GET'],
|
|
50
|
+
['/static/css/a.css', 'GET'],
|
|
51
|
+
['/file/download/linux/ubuntu/20.04.iso', 'GET'],
|
|
52
|
+
['/unix/freebsd/iso/download', 'GET'],
|
|
53
|
+
['/:sys/:release/iso/:handle', 'GET'],
|
|
54
|
+
['/:sys/:release/iso/:handle/a', 'GET'],
|
|
55
|
+
['/xyz', 'GET'],
|
|
56
|
+
['/xyz/1235/oop/oop', 'GET'],
|
|
57
|
+
['/xyz/1235/oo/oop', 'GET']
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
test_arr.forEach(a => {
|
|
61
|
+
console.log('find path:', a[0], a[1])
|
|
62
|
+
let r = app.router.findRealPath(a[0], a[1])
|
|
63
|
+
if (!r) {
|
|
64
|
+
console.log(' ----', 'not found\n')
|
|
65
|
+
} else {
|
|
66
|
+
console.log(' path:', r.key, ' args:', r.args, '\n')
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
const titbit = require('../lib/titbit');
|
|
2
|
+
|
|
3
|
+
let app = new titbit();
|
|
4
|
+
|
|
5
|
+
app.get(`/start/*`, async c => {
|
|
6
|
+
c.res.body = c.param;
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
app.get(`/:test/:o/:key/:z/:t`, async c => {
|
|
10
|
+
c.res.body = c.param;
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
app.get(`/test/:o/:key/:z/:t`, async c => {
|
|
14
|
+
c.res.body = c.param;
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
app.get(`/test/x/:key/:z/:t`, async c => {
|
|
18
|
+
c.res.body = c.param;
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
app.get(`/test/:o/:key/:z/:t/oo`, async c => {
|
|
22
|
+
c.res.body = c.param;
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
for(let i=0; i < 50; i++) {
|
|
26
|
+
app.get(`/test/${i}`, async c => {});
|
|
27
|
+
|
|
28
|
+
app.get(`/test/${i}/*`, async c => {
|
|
29
|
+
c.res.body = 'unix';
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
app.get(`/test/${i}-*`, async c => {});
|
|
33
|
+
|
|
34
|
+
app.get(`/test/x/${i}/:z/:t`, async c => {
|
|
35
|
+
c.res.body = i;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
app.post(`/test/x/${i}/:z/:t`, async c => {
|
|
39
|
+
c.res.body = i;
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
app.get(`/test/linux/unix/${i}`, async c => {
|
|
43
|
+
c.res.body = 'unix';
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
app.get(`/test/${i}/x/y/*`, async c => {
|
|
47
|
+
c.res.body = `x y ${i}`;
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
app.router.argsRouteSort()
|
|
53
|
+
|
|
54
|
+
for (let m in app.router.argsRoute) {
|
|
55
|
+
console.log(m, '')
|
|
56
|
+
for (let a of app.router.argsRoute[m]) {
|
|
57
|
+
console.log(` ${a.path}`)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
console.log(app.router.findRealPath('/test/35', 'GET'))
|
|
62
|
+
|
|
63
|
+
console.log(app.router.findRealPath('/test/x/49/x/y', 'GET'))
|
|
64
|
+
|
|
65
|
+
console.log(app.router.findRealPath('/test/35/a/s/d', 'GET'))
|
|
66
|
+
|
|
67
|
+
console.log(app.router.findRealPath('/test/35/x/y/w/e/r', 'GET'))
|
|
68
|
+
|
|
69
|
+
console.log(app.router.findRealPath('/test/35-*', 'GET'))
|
|
70
|
+
|
|
71
|
+
console.log(app.router.apiTable.GET['/test/x/1/:z/:t'])
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const titbit = require('../src/topbit.js');
|
|
2
|
+
|
|
3
|
+
var app = new titbit();
|
|
4
|
+
|
|
5
|
+
for(let i=0; i < 50; i++) {
|
|
6
|
+
app.get(`/test/x/${i}/:z/:t`, async c => {
|
|
7
|
+
c.res.body = i;
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
app.post(`/test/x/${i}/:z/:t`, async c => {
|
|
11
|
+
c.res.body = i;
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
app.get(`/test/linux/unix/${i}`, async c => {
|
|
15
|
+
c.res.body = 'unix';
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
app.get(`/test/${i}/*`, async c => {
|
|
19
|
+
c.res.body = 'unix';
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let startTime = Date.now();
|
|
24
|
+
|
|
25
|
+
let t = '';
|
|
26
|
+
let count = 0;
|
|
27
|
+
for (let i=0; i < 60000; i++) {
|
|
28
|
+
if ( app.router.findRealPath('/test/x/49/qwe/sdfe', 'GET') ) {
|
|
29
|
+
count += 1;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if ( app.router.findRealPath('/test/49/qwe/dsv/ds/sd/asdff', 'GET') ) {
|
|
33
|
+
count += 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if ( app.router.findRealPath('/test/x/49/unix/freebsd', 'POST') ) {
|
|
37
|
+
count += 1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if ( app.router.findRealPath('/test/linux/unix/49', 'GET') ) {
|
|
41
|
+
count += 1;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let endTime = Date.now();
|
|
46
|
+
|
|
47
|
+
console.log('timing', endTime - startTime, count);
|
|
48
|
+
console.log(parseInt(count / (endTime - startTime)) * 1000 );
|
|
49
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const titbit = require('../lib/titbit.js');
|
|
2
|
+
|
|
3
|
+
var app = new titbit();
|
|
4
|
+
|
|
5
|
+
for(let i=0; i < 50; i++) {
|
|
6
|
+
app.get(`/test/:x/${i}/:z/:t`, async c => {
|
|
7
|
+
c.res.body = i;
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
app.post(`/test/:x/${i}/:z/:t`, async c => {
|
|
11
|
+
c.res.body = i;
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
app.get(`/test/:linux/:unix/${i}`, async c => {
|
|
15
|
+
c.res.body = 'unix';
|
|
16
|
+
}, '@linux-unix');
|
|
17
|
+
|
|
18
|
+
app.get(`/test/${i}/*`, async c => {
|
|
19
|
+
c.res.body = 'unix';
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
console.log('路由数量:', app.router.count);
|
|
24
|
+
|
|
25
|
+
let startTime = Date.now();
|
|
26
|
+
|
|
27
|
+
let t = '';
|
|
28
|
+
let count = 0;
|
|
29
|
+
for (let i=0; i < 60000; i++) {
|
|
30
|
+
if ( app.router.findRealPath('/test/x/49/qwe/sdfe', 'GET') ) {
|
|
31
|
+
count += 1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if ( app.router.findRealPath('/test/49/qwe/dsv/ds/sd///////////asdff/', 'GET') ) {
|
|
35
|
+
count += 1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if ( app.router.findRealPath('/test/x/49/unix//////freebsd/', 'POST') ) {
|
|
39
|
+
count += 1;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if ( app.router.findRealPath('/test/linux/unix/49/', 'GET') ) {
|
|
43
|
+
count += 1;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
let endTime = Date.now();
|
|
48
|
+
|
|
49
|
+
console.log('timing', endTime - startTime, count);
|
|
50
|
+
console.log(parseInt(count / (endTime - startTime)) * 1000 );
|
|
51
|
+
|
package/test/test-url.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const parseurl = require('../lib/fastParseUrl').fpurl
|
|
4
|
+
const url = require('url')
|
|
5
|
+
|
|
6
|
+
let tmp = ''
|
|
7
|
+
let urls = []
|
|
8
|
+
|
|
9
|
+
for (let i = 0 ; i < 20000; i++) {
|
|
10
|
+
tmp = `https://qw.e21e/x/y/z?name=hel${i+1}&a=${i}&a=${i*i+1}&age=${(i+1) % 35}&say=${encodeURIComponent('我是中国人')}`
|
|
11
|
+
+ `&info=${encodeURIComponent('{"sign":"12dodfos9rhoaoz","x":"1=213"}')}`
|
|
12
|
+
+ `&t=${encodeURIComponent('a=123&b=213')}&t=${encodeURIComponent('x=123&y=234')}&==&a=*&v=@&sdk&=123&we==`
|
|
13
|
+
|
|
14
|
+
for (let k=0; k < 10; k++) {
|
|
15
|
+
tmp += `&x=${encodeURIComponent('人民')}${k+1}%rr`
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
for (let k=0; k < 35; k++) {
|
|
19
|
+
tmp += `&xyz${k}=${encodeURIComponent('测试')}${k+1}`
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
for (let k = 0; k < 50; k ++) {
|
|
23
|
+
tmp += `&r=% ${k}`
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
tmp += '&op=123&qwe&&&===#a=123?234'
|
|
27
|
+
|
|
28
|
+
//tmp = `https://a.qwq/xyy/qwd/qwd?x=123&b=234&c=435#123few`
|
|
29
|
+
urls.push(tmp)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
console.log(urls[0], '\n', urls[0].length)
|
|
33
|
+
|
|
34
|
+
let urlobj = []
|
|
35
|
+
|
|
36
|
+
let start_time = Date.now()
|
|
37
|
+
|
|
38
|
+
for (let i = 0; i < urls.length; i++) {
|
|
39
|
+
urlobj.push(parseurl(urls[i], true, false, 20))
|
|
40
|
+
//urlobj.push( new url.URL(urls[i], 'https://w3xm.cn') )
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
let end_time = Date.now()
|
|
44
|
+
|
|
45
|
+
console.log(`${urls.length}, ${end_time - start_time} ms`)
|
|
46
|
+
|
|
47
|
+
console.log(urlobj[0])
|
|
48
|
+
/*
|
|
49
|
+
for (let [k,v] of urlobj[0].searchParams) {
|
|
50
|
+
console.log(k, v)
|
|
51
|
+
}
|
|
52
|
+
*/
|
package/main.js
DELETED
|
File without changes
|