mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
First pass at adding WebRTC support.
This commit is contained in:
parent
65d6775303
commit
92aaf754fb
12 changed files with 164 additions and 141 deletions
12
meshrelay.js
12
meshrelay.js
|
@ -175,16 +175,16 @@ module.exports.CreateMeshRelay = function (parent, ws, req, domain) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
ws.flushSink = function () {
|
||||
try { ws.resume(); } catch (e) { }
|
||||
};
|
||||
|
||||
ws.flushSink = function () { try { ws.resume(); } catch (e) { } };
|
||||
|
||||
// When data is received from the mesh relay web socket
|
||||
ws.on('message', function (data) {
|
||||
//console.log(typeof data, data.length);
|
||||
//if (typeof data == 'string') console.log(data);
|
||||
if (this.peer != null) { try { this.pause(); this.peer.send(data, ws.flushSink); } catch (e) { } }
|
||||
if (this.peer != null) {
|
||||
//if (typeof data == 'string') { console.log('Relay: ' + data); }
|
||||
try { this.pause(); this.peer.send(data, ws.flushSink); } catch (e) { }
|
||||
}
|
||||
});
|
||||
|
||||
// If error, do nothing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue