V0.1.8 (#20)
* Add split tunneling (#17) * refactor imports * remove bandwidth tests from hooks * add autoclikers for call join * add autoclikers for call join * refactor - split to classes, update namings * display bot api in console * mute audio as a separate js script * fix NUL byte in udp for windows * update readme, collapse call webview, edit tab names * fix ports allocation when target is taken * fix ports allocation when target is taken * increment release version --------- Co-authored-by: senya <76913432+senya-sh@users.noreply.github.com> Co-authored-by: kulikov <user@Mac.lan>
This commit is contained in:
52 files changed
+1193
-629
No files matched your search
@@ -3,7 +3,7 @@
|
||||
if (window.__hookInstalled) return;
|
||||
window.__hookInstalled = true;
|
||||
|
||||
const WS_URL = 'ws://127.0.0.1:9000/ws';
|
||||
const WS_URL = 'ws://127.0.0.1:' + (window.WS_PORT || 9000) + '/ws';
|
||||
const log = (...args) => console.log('[HOOK]', ...args);
|
||||
const peers = [];
|
||||
let activeWS = null;
|
||||
@@ -278,31 +278,5 @@
|
||||
}
|
||||
|
||||
window.__hook = { peers: peers, log: log };
|
||||
window.__hook.runBandwidthTest = function(totalMB) {
|
||||
totalMB = totalMB || 1;
|
||||
if (!tunnelReady || !outboundDC) { log('Tunnel not ready'); return; }
|
||||
var chunkSize = 4096;
|
||||
var totalBytes = totalMB * 1024 * 1024;
|
||||
var sent = 0;
|
||||
var start = performance.now();
|
||||
sendRaw('bw:start');
|
||||
log('Starting bandwidth test: ' + totalMB + ' MB...');
|
||||
var sendBatch = function() {
|
||||
while (sent < totalBytes) {
|
||||
if (outboundDC.bufferedAmount > 512 * 1024) {
|
||||
setTimeout(sendBatch, 5);
|
||||
return;
|
||||
}
|
||||
sendRaw(new ArrayBuffer(chunkSize));
|
||||
sent += chunkSize;
|
||||
}
|
||||
sendRaw('bw:done');
|
||||
var elapsed = (performance.now() - start) / 1000;
|
||||
var kbps = (totalBytes * 8 / 1024 / elapsed).toFixed(1);
|
||||
log('=== SEND COMPLETE: ' + (totalBytes/1024).toFixed(1) + ' KB in ' + elapsed.toFixed(2) + 's = ' + kbps + ' kbps ===');
|
||||
};
|
||||
sendBatch();
|
||||
};
|
||||
|
||||
log('Hook installed');
|
||||
})();
|
||||
Reference in new issue
Block a user