V0.1.7 (#5)
* save url when connected and allow toggling connection on app start (#2) * mask ip in logs, reduce keep-alive logs frequency * update comment about debug link, migrate prefs to ktx * auto-connect for telemost * fix ice ipv6 resolving * auto-connect for vk * refactor hooks names * regenerate android resources * remove stale telemost dc * kick disconnected user from vk, refactor relay on mobile client, prevent double hook injection * refactor constants * set low importance for notification to avoid signals * stop vpn/relay at app destroy, reset state at vpn disconnect * prevent vk session close at video tunnel * kick disconnected user from vk, refactor relay on mobile client, prevent double hook injection * multiple tabs/calls, write android logs in file * update ux, fix fd lifecycle in tun2socks * increment release version --------- Co-authored-by: HukuToc2288 <hukutoc2288@yandex.ru> Co-authored-by: kulikov <user@Mac.lan>
This commit is contained in:
1 parent
e8da07179a
commit
84da73c324
52 files changed
+1510
-479
No files matched your search
@@ -1,7 +1,9 @@
|
||||
(() => {
|
||||
'use strict';
|
||||
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;
|
||||
@@ -16,7 +18,7 @@
|
||||
window.WebSocket = function(url, protocols) {
|
||||
var ws = protocols ? new OrigWebSocket(url, protocols) : new OrigWebSocket(url);
|
||||
if (url && (url.indexOf('strm.yandex') !== -1 || url.indexOf('jvb.telemost') !== -1)) {
|
||||
log('Signaling WS found: ' + url);
|
||||
log('Signaling WS found');
|
||||
signalingWS = ws;
|
||||
var origSend = ws.send.bind(ws);
|
||||
ws.send = function(data) {
|
||||
@@ -1,7 +1,9 @@
|
||||
(() => {
|
||||
'use strict';
|
||||
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;
|
||||
@@ -55,6 +57,7 @@
|
||||
if (dc !== activeDC) return;
|
||||
log('DataChannel closed');
|
||||
dcOpen = false;
|
||||
activeDC = null;
|
||||
};
|
||||
|
||||
let bwRecvBytes = 0;
|
||||
@@ -1,5 +1,7 @@
|
||||
(() => {
|
||||
'use strict';
|
||||
if (window.__hookInstalled) return;
|
||||
window.__hookInstalled = true;
|
||||
|
||||
const WS_URL = 'ws://127.0.0.1:9000/ws';
|
||||
const log = (...args) => console.log('[HOOK]', ...args);
|
||||
@@ -39,7 +41,7 @@
|
||||
window.WebSocket = function(url, protocols) {
|
||||
var ws = protocols ? new OrigWebSocket(url, protocols) : new OrigWebSocket(url);
|
||||
if (url && (url.indexOf('strm.yandex') !== -1 || url.indexOf('jvb.telemost') !== -1)) {
|
||||
log('Signaling WS found: ' + url);
|
||||
log('Signaling WS found');
|
||||
signalingWS = ws;
|
||||
var origSend = ws.send.bind(ws);
|
||||
ws.send = function(data) {
|
||||
@@ -1,5 +1,7 @@
|
||||
(() => {
|
||||
'use strict';
|
||||
if (window.__hookInstalled) return;
|
||||
window.__hookInstalled = true;
|
||||
|
||||
const WS_URL = 'ws://127.0.0.1:9000/ws';
|
||||
const log = (...args) => console.log('[HOOK]', ...args);
|
||||
@@ -55,6 +57,7 @@
|
||||
if (dc !== activeDC) return;
|
||||
log('DataChannel closed');
|
||||
dcOpen = false;
|
||||
activeDC = null;
|
||||
};
|
||||
|
||||
let bwRecvBytes = 0;
|
||||
@@ -1,5 +1,7 @@
|
||||
(() => {
|
||||
'use strict';
|
||||
if (window.__hookInstalled) return;
|
||||
window.__hookInstalled = true;
|
||||
|
||||
var PION_WS_URL = 'ws://127.0.0.1:' + (window.PION_PORT || 9001) + '/signaling';
|
||||
var log = function() {
|
||||
@@ -7,6 +9,17 @@
|
||||
console.log.apply(console, args);
|
||||
};
|
||||
|
||||
var reIp4 = /\d+\.\d+\.\d+\.\d+/g;
|
||||
var reIp6 = /[0-9a-fA-F]{1,4}(?::[0-9a-fA-F]{1,4}){2,7}|(?:[0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|::(?:[0-9a-fA-F]{1,4}:){0,5}[0-9a-fA-F]{1,4}/g;
|
||||
function maskAddr(s) {
|
||||
if (!s) return '';
|
||||
reIp4.lastIndex = 0;
|
||||
reIp6.lastIndex = 0;
|
||||
return s.replace(reIp4, function(ip) {
|
||||
var p = ip.split('.'); return p[0] + '.' + p[1] + '.x.x';
|
||||
}).replace(reIp6, 'x::x');
|
||||
}
|
||||
|
||||
var OrigWebSocket = window.WebSocket;
|
||||
var pionWS = null;
|
||||
var pionReady = false;
|
||||
@@ -148,6 +161,7 @@
|
||||
var match = url.match(/^(turn:|stun:)([^:?]+)(.*)/);
|
||||
if (match) {
|
||||
var resolved = AndroidBridge.resolveHost(match[2]);
|
||||
if (resolved && resolved.indexOf(':') !== -1) resolved = '[' + resolved + ']';
|
||||
if (resolved) return match[1] + resolved + match[3];
|
||||
}
|
||||
return url;
|
||||
@@ -167,7 +181,7 @@
|
||||
if (typeof AndroidBridge !== 'undefined' && AndroidBridge.getLocalIP) {
|
||||
var ip = AndroidBridge.getLocalIP();
|
||||
if (ip) {
|
||||
log('Local IP from Android: ' + ip);
|
||||
log('Local IP from Android: ' + maskAddr(ip));
|
||||
pendingMessages.push(JSON.stringify({ type: 'local-ip', data: ip }));
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
(() => {
|
||||
'use strict';
|
||||
if (window.__hookInstalled) return;
|
||||
window.__hookInstalled = true;
|
||||
|
||||
var PION_WS_URL = 'ws://127.0.0.1:' + (window.PION_PORT || 9001) + '/signaling';
|
||||
var log = function() {
|
||||
@@ -7,6 +9,17 @@
|
||||
console.log.apply(console, args);
|
||||
};
|
||||
|
||||
var reIp4 = /\d+\.\d+\.\d+\.\d+/g;
|
||||
var reIp6 = /[0-9a-fA-F]{1,4}(?::[0-9a-fA-F]{1,4}){2,7}|(?:[0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|::(?:[0-9a-fA-F]{1,4}:){0,5}[0-9a-fA-F]{1,4}/g;
|
||||
function maskAddr(s) {
|
||||
if (!s) return '';
|
||||
reIp4.lastIndex = 0;
|
||||
reIp6.lastIndex = 0;
|
||||
return s.replace(reIp4, function(ip) {
|
||||
var p = ip.split('.'); return p[0] + '.' + p[1] + '.x.x';
|
||||
}).replace(reIp6, 'x::x');
|
||||
}
|
||||
|
||||
var OrigWebSocket = window.WebSocket;
|
||||
var pionWS = null;
|
||||
var pionReady = false;
|
||||
@@ -106,8 +119,9 @@
|
||||
break;
|
||||
case 'connection-state':
|
||||
if (mockPC) {
|
||||
mockPC._connectionState = msg.data;
|
||||
log('Pion connection state:', msg.data);
|
||||
if (window.IS_CREATOR && (msg.data === 'closed' || msg.data === 'failed')) break;
|
||||
mockPC._connectionState = msg.data;
|
||||
if (msg.data === 'connected') {
|
||||
if (typeof AndroidBridge !== 'undefined' && AndroidBridge.onTunnelReady) {
|
||||
AndroidBridge.onTunnelReady();
|
||||
@@ -289,6 +303,11 @@
|
||||
return dc;
|
||||
},
|
||||
close: function() {
|
||||
if (window.IS_CREATOR) {
|
||||
sendToPion('close', {});
|
||||
log('MockPC.close (pion reset, state kept for VK)');
|
||||
return;
|
||||
}
|
||||
this._connectionState = 'closed';
|
||||
this._signalingState = 'closed';
|
||||
sendToPion('close', {});
|
||||
@@ -367,7 +386,7 @@
|
||||
}
|
||||
}
|
||||
if (msg.notification === 'remote-media-settings' || msg.notification === 'media-settings' || msg.notification === 'media-settings-changed') {
|
||||
log('VK media-settings notification:', JSON.stringify(msg).substring(0, 300));
|
||||
log('VK media-settings notification:', maskAddr(JSON.stringify(msg).substring(0, 300)));
|
||||
}
|
||||
if (msg.notification === 'participant-added' || msg.notification === 'participant-removed') {
|
||||
log('VK participant event: ' + msg.notification);
|
||||
Reference in new issue
Block a user