- Enable renaming of own display name permanently via UI

- Make peerId completely ephemeral
- Stabilize RTCConnection by closing connections cleanly
This commit is contained in:
schlagmichdoch 2023-03-01 21:35:00 +01:00
parent a3b348d9b6
commit d56ee87437
9 changed files with 377 additions and 115 deletions

View file

@ -453,7 +453,7 @@ class Peer {
this._setIP(request);
// set peer id
this._setPeerId(request)
this.id = crypto.randomUUID();
// is WebRTC supported ?
this.rtcSupported = request.url.indexOf('webrtc') > -1;
@ -525,15 +525,6 @@ class Peer {
return false;
}
_setPeerId(request) {
let peer_id = new URL(request.url, "http://server").searchParams.get("peer_id");
if (peer_id && Peer.isValidUuid(peer_id)) {
this.id = peer_id;
} else {
this.id = crypto.randomUUID();
}
}
toString() {
return `<Peer id=${this.id} ip=${this.ip} rtcSupported=${this.rtcSupported}>`
}