feat: add convenience functions, update Docker setup, and integrate Webpack for building WebRTC internals exporter
Build Docker Images for Pull Request / build (pull_request) Failing after 4m0s
Build Docker Images for Pull Request / build (pull_request) Failing after 4m0s
This commit is contained in:
1 parent
84479c786a
commit
b627ac6cb8
18 files changed
+9701
-40
No files matched your search
@@ -0,0 +1 @@
|
||||
(()=>{var t={751:function(t,e){!function(t){"use strict";function e(t){let e=t.length;for(;--e>=0;)t[e]=0}const a=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),s=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),r=new Array(576);e(r);const o=new Array(60);e(o);const l=new Array(512);e(l);const h=new Array(256);e(h);const d=new Array(29);e(d);const _=new Array(30);function c(t,e,a,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}let u,f,w;function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(_);const m=t=>t<256?l[t]:l[256+(t>>>7)],b=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},p=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,b(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},k=(t,e,a)=>{p(t,a[2*e],a[2*e+1])},v=(t,e)=>{let a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},y=(t,e,a)=>{const n=new Array(16);let i,s,r=0;for(i=1;i<=15;i++)r=r+a[i-1]<<1,n[i]=r;for(s=0;s<=e;s++){let e=t[2*s+1];0!==e&&(t[2*s]=v(n[e]++,e))}},x=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},z=t=>{t.bi_valid>8?b(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=(t,e,a,n)=>{const i=2*e,s=2*a;return t[i]<t[s]||t[i]===t[s]&&n[e]<=n[a]},E=(t,e,a)=>{const n=t.heap[a];let i=a<<1;for(;i<=t.heap_len&&(i<t.heap_len&&A(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!A(e,n,t.heap[i],t.depth));)t.heap[a]=t.heap[i],a=i,i<<=1;t.heap[a]=n},R=(t,e,i)=>{let s,r,o,l,c=0;if(0!==t.sym_next)do{s=255&t.pending_buf[t.sym_buf+c++],s+=(255&t.pending_buf[t.sym_buf+c++])<<8,r=t.pending_buf[t.sym_buf+c++],0===s?k(t,r,e):(o=h[r],k(t,o+256+1,e),l=a[o],0!==l&&(r-=d[o],p(t,r,l)),s--,o=m(s),k(t,o,i),l=n[o],0!==l&&(s-=_[o],p(t,s,l)))}while(c<t.sym_next);k(t,256,e)},Z=(t,e)=>{const a=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,s=e.stat_desc.elems;let r,o,l,h=-1;for(t.heap_len=0,t.heap_max=573,r=0;r<s;r++)0!==a[2*r]?(t.heap[++t.heap_len]=h=r,t.depth[r]=0):a[2*r+1]=0;for(;t.heap_len<2;)l=t.heap[++t.heap_len]=h<2?++h:0,a[2*l]=1,t.depth[l]=0,t.opt_len--,i&&(t.static_len-=n[2*l+1]);for(e.max_code=h,r=t.heap_len>>1;r>=1;r--)E(t,a,r);l=s;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],E(t,a,1),o=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=o,a[2*l]=a[2*r]+a[2*o],t.depth[l]=(t.depth[r]>=t.depth[o]?t.depth[r]:t.depth[o])+1,a[2*r+1]=a[2*o+1]=l,t.heap[1]=l++,E(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const a=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,r=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length;let h,d,_,c,u,f,w=0;for(c=0;c<=15;c++)t.bl_count[c]=0;for(a[2*t.heap[t.heap_max]+1]=0,h=t.heap_max+1;h<573;h++)d=t.heap[h],c=a[2*a[2*d+1]+1]+1,c>l&&(c=l,w++),a[2*d+1]=c,d>n||(t.bl_count[c]++,u=0,d>=o&&(u=r[d-o]),f=a[2*d],t.opt_len+=f*(c+u),s&&(t.static_len+=f*(i[2*d+1]+u)));if(0!==w){do{for(c=l-1;0===t.bl_count[c];)c--;t.bl_count[c]--,t.bl_count[c+1]+=2,t.bl_count[l]--,w-=2}while(w>0);for(c=l;0!==c;c--)for(d=t.bl_count[c];0!==d;)_=t.heap[--h],_>n||(a[2*_+1]!==c&&(t.opt_len+=(c-a[2*_+1])*a[2*_],a[2*_+1]=c),d--)}})(t,e),y(a,h,t.bl_count)},U=(t,e,a)=>{let n,i,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)i=r,r=e[2*(n+1)+1],++o<l&&i===r||(o<h?t.bl_tree[2*i]+=o:0!==i?(i!==s&&t.bl_tree[2*i]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,s=i,0===r?(l=138,h=3):i===r?(l=6,h=3):(l=7,h=4))},S=(t,e,a)=>{let n,i,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),n=0;n<=a;n++)if(i=r,r=e[2*(n+1)+1],!(++o<l&&i===r)){if(o<h)do{k(t,i,t.bl_tree)}while(0!=--o);else 0!==i?(i!==s&&(k(t,i,t.bl_tree),o--),k(t,16,t.bl_tree),p(t,o-3,2)):o<=10?(k(t,17,t.bl_tree),p(t,o-3,3)):(k(t,18,t.bl_tree),p(t,o-11,7));o=0,s=i,0===r?(l=138,h=3):i===r?(l=6,h=3):(l=7,h=4)}};let T=!1;const O=(t,e,a,n)=>{p(t,0+(n?1:0),3),z(t),b(t,a),b(t,~a),a&&t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a};var D={_tr_init:t=>{T||((()=>{let t,e,s,g,m;const b=new Array(16);for(s=0,g=0;g<28;g++)for(d[g]=s,t=0;t<1<<a[g];t++)h[s++]=g;for(h[s-1]=g,m=0,g=0;g<16;g++)for(_[g]=m,t=0;t<1<<n[g];t++)l[m++]=g;for(m>>=7;g<30;g++)for(_[g]=m<<7,t=0;t<1<<n[g]-7;t++)l[256+m++]=g;for(e=0;e<=15;e++)b[e]=0;for(t=0;t<=143;)r[2*t+1]=8,t++,b[8]++;for(;t<=255;)r[2*t+1]=9,t++,b[9]++;for(;t<=279;)r[2*t+1]=7,t++,b[7]++;for(;t<=287;)r[2*t+1]=8,t++,b[8]++;for(y(r,287,b),t=0;t<30;t++)o[2*t+1]=5,o[2*t]=v(t,5);u=new c(r,a,257,286,15),f=new c(o,n,0,30,15),w=new c(new Array(0),i,0,19,7)})(),T=!0),t.l_desc=new g(t.dyn_ltree,u),t.d_desc=new g(t.dyn_dtree,f),t.bl_desc=new g(t.bl_trLine truncated
|
||||
@@ -6,17 +6,17 @@ function log(...args) {
|
||||
|
||||
log("loaded");
|
||||
|
||||
import "/assets/pako.min.js";
|
||||
import "./assets/pako.min.js";
|
||||
|
||||
const DEFAULT_OPTIONS = {
|
||||
url: "http://localhost:9092",
|
||||
url: process.env.WEBRTC_INTERNALS_EXPORTER_URL + ":9092",
|
||||
username: "",
|
||||
password: "",
|
||||
updateInterval: 2,
|
||||
gzip: false,
|
||||
job: "webrtc-internals-exporter",
|
||||
enabledOrigins: { },
|
||||
enabledStats: ["data-channel", "local-candidate", "remote-candidate"]
|
||||
enabledOrigins: {},
|
||||
enabledStats: ["data-channel", "local-candidate", "remote-candidate", "candidate-pair"]
|
||||
};
|
||||
|
||||
const options = {};
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
}
|
||||
],
|
||||
"background": {
|
||||
"service_worker": "background.js",
|
||||
"service_worker": "background.bundle.js",
|
||||
"type": "module"
|
||||
},
|
||||
"web_accessible_resources": [
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
shouldPrintComment: () => false
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
const { execSync } = require('child_process');
|
||||
const args = process.argv.slice(2);
|
||||
|
||||
let url = '';
|
||||
|
||||
args.forEach((arg, index) => {
|
||||
if (arg === '-u' || arg === '--url') {
|
||||
url = args[index + 1];
|
||||
} else if (arg === '-h' || arg === '--help') {
|
||||
console.log('Usage: npm run build -- [-u|--url <url>]');
|
||||
console.log('Options:');
|
||||
console.log(' -u, --url <url> URL to use for the extension collector server');
|
||||
console.log(' -h, --help Display this help message');
|
||||
process.exit(0);
|
||||
} else if (arg.startsWith('-')) {
|
||||
console.error(`Unrecognized argument: ${arg}`);
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
if (url) {
|
||||
console.log(`Building with URL: ${url}`);
|
||||
execSync(`webpack --env URL=${url}`, { stdio: 'inherit' });
|
||||
} else {
|
||||
execSync('webpack', { stdio: 'inherit' });
|
||||
}
|
||||
+9355
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "webrtc-internals-exporter",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "node build.js"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "Mirko Milovanovic",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"babel-loader": "^8.2.2",
|
||||
"clean-webpack-plugin": "^3.0.0",
|
||||
"copy-webpack-plugin": "^12.0.2",
|
||||
"file-loader": "^6.2.0",
|
||||
"html-webpack-plugin": "^5.3.1",
|
||||
"mini-css-extract-plugin": "^1.6.0",
|
||||
"postcss": "^8.2.14",
|
||||
"postcss-loader": "^5.2.0",
|
||||
"postcss-preset-env": "^10.1.4",
|
||||
"sass": "^1.32.12",
|
||||
"sass-loader": "^11.0.1",
|
||||
"serve": "^14.2.4",
|
||||
"style-loader": "^2.0.0",
|
||||
"terser-webpack-plugin": "^5.1.1",
|
||||
"ts-loader": "^9.1.2",
|
||||
"typescript": "^4.2.4",
|
||||
"webpack": "^5.38.1",
|
||||
"webpack-cli": "^4.7.2",
|
||||
"webpack-dev-server": "^5.2.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
const path = require('path');
|
||||
const { EnvironmentPlugin } = require('webpack');
|
||||
|
||||
module.exports = (env) => {
|
||||
const url = env.URL || 'http://localhost';
|
||||
|
||||
return {
|
||||
entry: '../background.js',
|
||||
target: 'web',
|
||||
mode: 'production',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js?$/,
|
||||
use: 'babel-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
],
|
||||
},
|
||||
resolve: { extensions: ['.tsx', '.ts', '.js'] },
|
||||
output: {
|
||||
filename: 'background.bundle.js',
|
||||
path: path.resolve(__dirname, '../'),
|
||||
publicPath: '',
|
||||
},
|
||||
plugins: [
|
||||
new EnvironmentPlugin({
|
||||
WEBRTC_INTERNALS_EXPORTER_URL: url,
|
||||
}),
|
||||
],
|
||||
};
|
||||
};
|
||||
Reference in new issue
Block a user