Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
1aaa0bd
Don't immediately renegotiate for initial streams
feross Jun 2, 2020
4099327
add types to all 'signal' messages to aid debugging
feross Jun 2, 2020
d1f0233
add debug log
feross Jun 2, 2020
0bc2fac
v1.0.0
momakes3 Jul 25, 2020
fc3b88f
Merge pull request #1 from feross/no-immediate-renegotiate
momakes3 Jul 25, 2020
e7ab16e
Add ice restart
momakes3 Jul 25, 2020
d48e57a
Add a flag to prevent restarting restart
momakes3 Jul 26, 2020
ffc31f0
v1.1.1
momakes3 Jul 26, 2020
487ea36
Add build
momakes3 Jul 26, 2020
ea5c3f4
v1.1.2
momakes3 Jul 26, 2020
aa8787e
Remove connection state change destroy
momakes3 Jul 26, 2020
c853679
v1.1.3
momakes3 Jul 26, 2020
f29710f
9.10.0
feross Mar 18, 2021
bf23c34
Listen to iceGatheringState for completed
soup-in-boots Dec 14, 2020
e28a270
Attempt to support manual ice restarts
soup-in-boots Dec 14, 2020
794da9a
Basic test case for ICE restarts that still fails
soup-in-boots Dec 14, 2020
3818881
feature/ice-restart: fix needsNegotiation usage
soup-in-boots Mar 5, 2022
4840a39
Merge branch 'master' into master
soup-in-boots Mar 5, 2022
294d418
rename index.js to full.js to facilitate merging
KW-M Sep 7, 2024
8b52a69
rename index.js to full.js and add formating config to faciltate merging
KW-M Sep 7, 2024
83a7de5
Merge branch master of 'amdglobal/simple-peer' into ice-restart-feature
KW-M Sep 7, 2024
21733fb
Merge branch 'main' of 'thereteam/simple-peer' into ice-restart-featu…
KW-M Sep 7, 2024
932f699
Better handling of the _iceComplete flag to support ice recovery
KW-M Oct 1, 2024
341f2ea
Make iceRestartEnabled option more explicit. Make IceFailureRecoveryT…
KW-M Oct 1, 2024
d3b42d4
Allow manaual restartIce() calls to restart the IceFailureRecoveryTi…
KW-M Oct 2, 2024
a987286
fix: _iceComplete event not emmited with trickle disabled & varous c…
KW-M Oct 24, 2024
159d39b
Update README to show new ICE Restart options.
KW-M Oct 25, 2024
1b563bb
Improve JSDoc comments and typing for better editor intelisense.
KW-M Oct 25, 2024
e3d81aa
allow _maybeReady() to run again after initial connection for updatin…
KW-M Oct 26, 2024
cc7bca6
Copy ice restart changes from full.js to lite.js
KW-M Oct 27, 2024
8511707
Update ice restart test case.
KW-M Oct 27, 2024
7440aee
Update jsDoc typing comments to apply to full.js, index.js and lite.js
KW-M Oct 27, 2024
908e967
switch to preliminary promise based ice recovery api
KW-M Dec 4, 2024
439d8a2
Fix remote ice restart detection in firefox, cleanup dead code.
KW-M Mar 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"editor.formatOnSave": false,
"typescript.format.insertSpaceBeforeFunctionParenthesis": true,
"typescript.format.insertSpaceAfterConstructor": true,
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"javascript.format.insertSpaceAfterConstructor": true
}
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ If `opts` is specified, then the default options (shown below) will be overridde
trickle: true,
allowHalfTrickle: false,
wrtc: {}, // RTCPeerConnection/RTCSessionDescription/RTCIceCandidate
objectMode: false
objectMode: false,
iceRestartEnabled: "onFailure",
iceFailureRecoveryTimeout: 5000
}
```

Expand All @@ -302,6 +304,13 @@ The options do the following:

- `objectMode` - set to `true` to create the stream in [Object Mode](https://nodejs.org/api/stream.html#stream_object_mode). In this mode, incoming string data is not automatically converted to `Buffer` objects.

- `iceRestartEnabled` - attempt to automatically reconnect if the network path between peers changes. Warning: may crash firefox versions <= 47
- Set to "onDisconnect" to attempt reconnection when ICE state changes to disconnected (connection dropped temporarily and may not need restart)
- Set to "onFailure" to trigger reconnection when ICE state changes to failed (connection path fully broken, reconnection required).
- Set to `false` to disable automatic ICE restart - ICE restart can still be triggered manually using `peer.restartIce()`

- `iceFailureRecoveryTimeout` - miliseconds to wait for ICE restart to complete after the ICE state reaches "failed".

### `peer.signal(data)`

Call this method whenever the remote peer emits a `peer.on('signal')` event.
Expand Down Expand Up @@ -432,6 +441,12 @@ peer.on('stream', stream => {

Received a remote audio/video track. Streams may contain multiple tracks.

### `peer.on('reconnect', () => {})`

Fired when the peer connection has been re-established after a temporary disconnection due to network changes (ICE Restart) or, in some cases, successful renegotiation.

The connection is ready to use. The local and remote network canidates & IP addresses may have changed.

### `peer.on('close', () => {})`

Called when the peer connection has closed.
Expand Down
Loading