Decrease redundancy by changing the way the websocket fallback is included; Adding new env var SIGNALING_SERVER to host client files but use another server for signaling.

This commit is contained in:
schlagmichdoch 2023-11-08 20:31:57 +01:00
parent cb72edef20
commit 3439e7f6d4
62 changed files with 439 additions and 10101 deletions

View file

@ -17,8 +17,8 @@ export default class Peer {
// set peer id
this._setPeerId(request);
// is WebRTC supported ?
this.rtcSupported = request.url.indexOf('webrtc') > -1;
// is WebRTC supported
this._setRtcSupported(request);
// set name
this._setName(request);
@ -133,6 +133,11 @@ export default class Peer {
}
}
_setRtcSupported(request) {
const searchParams = new URL(request.url, "http://server").searchParams;
this.rtcSupported = searchParams.get("webrtc_supported") === "true";
}
_setName(req) {
let ua = parser(req.headers['user-agent']);