From ddb42f152797a08d50f7be709c66b0103a483757 Mon Sep 17 00:00:00 2001 From: Antti Luukka Date: Thu, 7 Nov 2024 09:57:09 +0200 Subject: [PATCH 1/4] Set maxRetransmits to zero for unreliable connection --- lib/negotiator.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/negotiator.ts b/lib/negotiator.ts index 6f5f46215..05b9ea366 100644 --- a/lib/negotiator.ts +++ b/lib/negotiator.ts @@ -36,6 +36,10 @@ export class Negotiator< const config: RTCDataChannelInit = { ordered: !!options.reliable }; + if (!config.ordered) { + config.maxRetransmits = 0; + } + const dataChannel = peerConnection.createDataChannel( dataConnection.label, config, From d669da00ff1878c4c26084fe0980b94bb0518a5b Mon Sep 17 00:00:00 2001 From: Antti Luukka Date: Thu, 7 Nov 2024 11:46:41 +0200 Subject: [PATCH 2/4] Prepare repo for github npm registry publishing --- .gitignore | 1 + .npmrc.example | 3 +++ package.json | 7 +++++-- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .npmrc.example diff --git a/.gitignore b/.gitignore index 4cf84df8b..a833beaa5 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ browserstack.err .tscache test/public .vscode/ +.npmrc diff --git a/.npmrc.example b/.npmrc.example new file mode 100644 index 000000000..6a60fcf07 --- /dev/null +++ b/.npmrc.example @@ -0,0 +1,3 @@ +# Create Github Personal Access Token (classic) with write:packages scope +# at https://github.com/settings/tokens to be able to publish packages to Github npm registry locally. +//npm.pkg.github.com/:_authToken=XXXXXXX \ No newline at end of file diff --git a/package.json b/package.json index 9acfd30eb..6938e1c7f 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "peerjs", + "name": "@deadsetbit/peerjs", "version": "1.5.4", "keywords": [ "peerjs", @@ -14,7 +14,10 @@ }, "repository": { "type": "git", - "url": "https://github.com/peers/peerjs" + "url": "https://github.com/deadsetbit/peerjs" + }, + "publishConfig": { + "registry": "https://npm.pkg.github.com" }, "license": "MIT", "contributors": [ From 7bc6dd591f96fbcd7a17a79f7894624ae8e8f387 Mon Sep 17 00:00:00 2001 From: Antti Luukka Date: Thu, 7 Nov 2024 20:32:39 +0200 Subject: [PATCH 3/4] Do not automatically close connection on "failed": - closing should be done in the app side when appropriate --- lib/negotiator.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/negotiator.ts b/lib/negotiator.ts index 05b9ea366..29fb7206e 100644 --- a/lib/negotiator.ts +++ b/lib/negotiator.ts @@ -97,11 +97,11 @@ export class Negotiator< logger.log( "iceConnectionState is failed, closing connections to " + peerId, ); - this.connection.emitError( - BaseConnectionErrorType.NegotiationFailed, - "Negotiation of connection to " + peerId + " failed.", - ); - this.connection.close(); + // this.connection.emitError( + // BaseConnectionErrorType.NegotiationFailed, + // "Negotiation of connection to " + peerId + " failed.", + // ); + // this.connection.close(); break; case "closed": logger.log( From 5cf51e4727f2c89840e2e1c33ea1da0f1a0cc200 Mon Sep 17 00:00:00 2001 From: Antti Luukka Date: Thu, 7 Nov 2024 20:51:13 +0200 Subject: [PATCH 4/4] Add fork suffix to package version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6938e1c7f..ae5bb1e60 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@deadsetbit/peerjs", - "version": "1.5.4", + "version": "1.5.4-fork.0", "keywords": [ "peerjs", "webrtc",