@vpalmisano/webrtcperf 4.7.9 → 4.8.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/app.min.js +1 -1
- package/build/src/config.js +1 -0
- package/build/src/config.js.map +1 -1
- package/build/src/server.js +8 -3
- package/build/src/server.js.map +1 -1
- package/build/src/session.js +4 -3
- package/build/src/session.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/config.ts +1 -0
- package/src/server.ts +8 -3
- package/src/session.ts +4 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vpalmisano/webrtcperf",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.8.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/vpalmisano/webrtcperf.git"
|
|
@@ -53,14 +53,14 @@
|
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@google/genai": "^1.50.1",
|
|
55
55
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
56
|
-
"@puppeteer/browsers": "^
|
|
56
|
+
"@puppeteer/browsers": "^3.0.4",
|
|
57
57
|
"@vpalmisano/throttler": "0.0.14",
|
|
58
|
-
"@vpalmisano/webrtcperf-js": "^1.
|
|
58
|
+
"@vpalmisano/webrtcperf-js": "^1.3.1",
|
|
59
59
|
"axios": "^1.15.2",
|
|
60
60
|
"chalk-template": "^1.1.2",
|
|
61
61
|
"change-case": "^4.1.2",
|
|
62
62
|
"compression": "^1.8.1",
|
|
63
|
-
"convict": "^6.2.
|
|
63
|
+
"convict": "^6.2.5",
|
|
64
64
|
"convict-format-with-validator": "^6.2.0",
|
|
65
65
|
"debug-level": "^4.1.1",
|
|
66
66
|
"dockerode": "^4.0.10",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"fast-stats": "^0.0.7",
|
|
70
70
|
"form-data": "^4.0.4",
|
|
71
71
|
"googleapis": "^164.1.0",
|
|
72
|
-
"ipaddr.js": "^2.
|
|
72
|
+
"ipaddr.js": "^2.4.0",
|
|
73
73
|
"json5": "^2.2.3",
|
|
74
74
|
"lorem-ipsum": "^2.0.8",
|
|
75
75
|
"marked": "^16.3.0",
|
|
@@ -79,16 +79,16 @@
|
|
|
79
79
|
"pidtree": "^0.6.0",
|
|
80
80
|
"pidusage": "^4.0.1",
|
|
81
81
|
"prom-client": "^15.1.3",
|
|
82
|
-
"puppeteer": "^
|
|
83
|
-
"puppeteer-core": "^
|
|
82
|
+
"puppeteer": "^25.1.0",
|
|
83
|
+
"puppeteer-core": "^25.1.0",
|
|
84
84
|
"puppeteer-extra": "^3.3.6",
|
|
85
85
|
"puppeteer-extra-plugin-stealth": "^2.11.2",
|
|
86
86
|
"puppeteer-intercept-and-modify-requests": "^1.3.1",
|
|
87
87
|
"sprintf-js": "^1.1.3",
|
|
88
88
|
"tar-fs": "^3.1.1",
|
|
89
89
|
"toml": "^3.0.0",
|
|
90
|
-
"ws": "^8.
|
|
91
|
-
"yaml": "^2.
|
|
90
|
+
"ws": "^8.21.0",
|
|
91
|
+
"yaml": "^2.9.0",
|
|
92
92
|
"zod": "3"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
package/src/config.ts
CHANGED
|
@@ -767,6 +767,7 @@ alert will be successful only when at least 95% of the checks pass.`,
|
|
|
767
767
|
doc: `The HTTP server basic auth secret. The auth user name is set to \`admin\` by default.`,
|
|
768
768
|
format: String,
|
|
769
769
|
default: 'secret',
|
|
770
|
+
nullable: true,
|
|
770
771
|
env: 'SERVER_SECRET',
|
|
771
772
|
arg: 'server-secret',
|
|
772
773
|
},
|
package/src/server.ts
CHANGED
|
@@ -85,7 +85,7 @@ export class Server {
|
|
|
85
85
|
)
|
|
86
86
|
|
|
87
87
|
this.app.use((req: express.Request, res: express.Response, next: express.NextFunction) => {
|
|
88
|
-
if (req.query.auth === this.serverSecret) {
|
|
88
|
+
if (!this.serverSecret || req.query.auth === this.serverSecret) {
|
|
89
89
|
return next()
|
|
90
90
|
}
|
|
91
91
|
const credentials = auth(req)
|
|
@@ -121,7 +121,7 @@ export class Server {
|
|
|
121
121
|
log.error(`mkdir ${this.serverData} error: ${err.message}`)
|
|
122
122
|
})
|
|
123
123
|
this.app.get('/data', this.getDataArchive.bind(this))
|
|
124
|
-
this.app.get('/data
|
|
124
|
+
this.app.get('/data/*filepath', this.getData.bind(this))
|
|
125
125
|
}
|
|
126
126
|
if (this.videoCachePath) {
|
|
127
127
|
log.debug(`using videoCachePath: ${this.videoCachePath}`)
|
|
@@ -432,7 +432,9 @@ export class Server {
|
|
|
432
432
|
* content in tar.gz format.
|
|
433
433
|
*/
|
|
434
434
|
private getData(req: express.Request, res: express.Response, next: express.NextFunction): void {
|
|
435
|
-
const
|
|
435
|
+
const requestPath = req.params.filepath as string | string[]
|
|
436
|
+
const filepath = Array.isArray(requestPath) ? requestPath.join('/') : requestPath
|
|
437
|
+
const paramPath = path.normalize(filepath).replace(/^(\.\.(\/|\\|$))+/, '')
|
|
436
438
|
log.debug(`GET /data/${paramPath}`, req.query)
|
|
437
439
|
const fpath = path.resolve(this.serverData, paramPath)
|
|
438
440
|
if (!fs.existsSync(fpath)) {
|
|
@@ -441,6 +443,9 @@ export class Server {
|
|
|
441
443
|
if (req.query.range && !req.headers.range) {
|
|
442
444
|
req.headers.range = `bytes=${req.query.range}`
|
|
443
445
|
}
|
|
446
|
+
if (['.js', '.mjs', '.cjs'].includes(path.extname(fpath).toLowerCase())) {
|
|
447
|
+
res.type('application/javascript')
|
|
448
|
+
}
|
|
444
449
|
res.sendFile(fpath, { dotfiles: 'allow' })
|
|
445
450
|
}
|
|
446
451
|
|
package/src/session.ts
CHANGED
|
@@ -727,7 +727,8 @@ export class Session extends EventEmitter {
|
|
|
727
727
|
]
|
|
728
728
|
|
|
729
729
|
log.debug(`[session ${this.id}] Using args:\n ${args.join('\n ')}`)
|
|
730
|
-
|
|
730
|
+
const defaultArgs = await puppeteer.defaultArgs()
|
|
731
|
+
log.debug(`[session ${this.id}] Default args:\n ${defaultArgs.join('\n ')}`)
|
|
731
732
|
|
|
732
733
|
try {
|
|
733
734
|
this.browser = await puppeteer.launch({
|
|
@@ -1670,10 +1671,10 @@ mv ${logFilePath}.tmp ${logFilePath};
|
|
|
1670
1671
|
collectedStats.usedCpu = systemStats.usedCpu
|
|
1671
1672
|
collectedStats.usedMemory = systemStats.usedMemory
|
|
1672
1673
|
collectedStats.usedGpu = systemStats.usedGpu
|
|
1673
|
-
if (collectedStats.usedCpu >
|
|
1674
|
+
if (collectedStats.usedCpu > 90) {
|
|
1674
1675
|
log.warn(`High system CPU usage: ${collectedStats.usedCpu.toFixed(2)}%`)
|
|
1675
1676
|
}
|
|
1676
|
-
if (collectedStats.usedMemory >
|
|
1677
|
+
if (collectedStats.usedMemory > 90) {
|
|
1677
1678
|
log.warn(`High system memory usage: ${collectedStats.usedMemory.toFixed(2)}%`)
|
|
1678
1679
|
}
|
|
1679
1680
|
}
|