Skip to content

Commit 9bcca2d

Browse files
committed
readme: documented relay reconnection functions
1 parent db8c18c commit 9bcca2d

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -655,10 +655,11 @@ the same namespace will return the same room instance.
655655
[`Libp2pOptions`](https://libp2p.github.io/js-libp2p/types/libp2p.index.Libp2pOptions.html)
656656
where you can specify a list of static peers for bootstrapping.
657657

658-
- `disableWatchOnline` - **(optional)** Boolean (default: `false`) that
659-
when set to `true` disables automatically pausing and resuming reconnection
660-
attempts when the browser goes offline and comes back online. This is useful
661-
if you want to manage this behavior yourself.
658+
- `manualRelayReconnection` - **(optional, 🐦 Nostr and 🌊 BitTorrent only)**
659+
Boolean (default: `false`) that when set to `true` disables
660+
automatically pausing and resuming reconnection attempts when the browser
661+
goes offline and comes back online. This is useful if you want to manage
662+
this behavior yourself.
662663

663664
- `roomId` - A string to namespace peers and events within a room.
664665

@@ -904,6 +905,18 @@ console.log(trystero.getRelaySockets())
904905
// }
905906
```
906907

908+
### `pauseRelayReconnection()`
909+
910+
**(🐦 Nostr, 🌊 BitTorrent only)** Normally Trystero will try to automatically
911+
reconnect to relay sockets unless `manualRelayReconnection: true` is set in
912+
the room config. Calling this function stops relay reconnection attempts until
913+
`resumeRelayReconnection()` is called.
914+
915+
### `resumeRelayReconnection()`
916+
917+
**(🐦 Nostr, 🌊 BitTorrent, only)** Allows relay reconnection attempts to resume.
918+
(See `pauseRelayReconnection()` above).
919+
907920
### `getOccupants(config, roomId)`
908921

909922
**(πŸ”₯ Firebase only)** Returns a promise that resolves to a list of user IDs

0 commit comments

Comments
Β (0)