Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Releases: dmotz/trystero

0.25.2

11 Jun 03:08
@dmotz dmotz

Choose a tag to compare

Fixes

  • Fixed issue where leaving rooms would cause recreated and orphaned sockets (thanks to @peitschie for reporting)

Contributors

peitschie
Assets 2
Loading

0.25.1

26 May 21:33
@dmotz dmotz

Choose a tag to compare

Fixes

  • Nostr - subscriptions are now restored automatically after relay socket reconnects (thanks to @peitschie for contributing)
  • Relay sockets now reconnect more reliably, with capped/jittered backoff to avoid long retry delays
  • Announce failures are now caught and logged without stopping future announce attempts

Contributors

peitschie
Loading

0.25.0

25 May 00:46
@dmotz dmotz

Choose a tag to compare

Improvements

  • Actions have a new object-based API with request/response support. makeAction() now returns an action object with send(), onMessage/onRequest, request(), requestMany(), and progress hooks depending on the action kind. Thanks to @Abdullah-Azbah for writing the initial request/response proposal.
  • Added passive room mode for backup peers. Passive rooms stay dormant until they hear an active peer, avoid connecting to other passive peers, and deactivate again when active work is done. This should make standby/server-side peers much cheaper to keep around. You can use these peers for syncing persisted data. Thanks to @tionis for adding this.
  • onJoinError will now report cases where peers exchange SDP but cannot establish a WebRTC connection, which usually means TURN servers are needed or misconfigured.
  • Media APIs now use options objects, matching the new action API shape. This makes targeted sends and metadata clearer across streams, tracks, and replacements.
  • Added createTopicStrategy() that makes writing custom pub/sub signaling strategies even simpler. createStrategy() is still available as the lower-level API for protocols that need more control.
  • Nostr subscriptions are now batched, and Torrent passive rooms announce less aggressively while dormant.

⚠️ Breaking changes

room.makeAction() no longer returns [send, receive, progress]. It now returns an action object:

const drink = room.makeAction('drink')
drink.send({drink: 'negroni'}, {target: peerId})
drink.onMessage = (data, {peerId}) => {
 console.log('got drink from', peerId, data)
}

Request/response actions can be created with kind: 'request':

const isEven = room.makeAction('isEven', {
 kind: 'request',
 onRequest: n => n % 2 === 0
})
const result = await isEven.request(42, {
 target: peerId,
 timeoutMs: 1000
})

Room event handlers are now nullable callback properties instead of registration functions:

room.onPeerJoin = peerId => console.log(`${peerId} joined`)
room.onPeerLeave = peerId => console.log(`${peerId} left`)
room.onPeerStream = (stream, peerId, metadata) => {}
room.onPeerTrack = (track, stream, peerId, metadata) => {}

Media targeting and metadata now use options objects:

room.addStream(stream, {
 target: peerId,
 metadata: {kind: 'screen'}
})

The same shape applies to removeStream(), addTrack(), removeTrack(), and replaceTrack().

This will require existing codebases to migrate syntax when upgrading to 0.25.0.

Contributors

tionis and Abdullah-Azbah
Loading
Kiriller12 and jjmhalew reacted with hooray emoji
2 people reacted

0.24.0

27 Apr 22:59
@dmotz dmotz

Choose a tag to compare

Improvements

  • πŸ”Œ Added a self-hosted WebSocket relay package (@trystero-p2p/ws-relay). See the docs for how to run the server and connect from browsers. If anyone is interested in running a public relay for Trystero users, get in touch.
  • Peers will usually connect faster now due to a more proactive announce cycle (thanks @rogersanick)

Fixes

  • Stream events will now fire correctly on cross-room peers that have shared connections

⚠️ Breaking changes

  • As part of the ws-relay addition, relay-specific options have been consolidated under the relayConfig field of the config object passed to joinRoom(). For example:
    joinRoom(
     {
     appId: 'my-app', 
     password: 'foobar', 
     relayConfig: {redundancy: 5}
     }, 
     'room-id'
    )

Some fields have been renamed, so check the docs. This cleans up the shape of the config object and keeps types simpler as different strategies use different types of configs.

Contributors

rogersanick
Loading
ericsharma, Kiriller12, jjmhalew, rogersanick, and vrtmrz reacted with heart emoji
5 people reacted

0.23.1

21 Apr 00:17
@dmotz dmotz

Choose a tag to compare

Improvements

  • 🌊 Torrent - Fixed issues with connecting to trackers running on aquatic
  • 🐦 Nostr - Removed dead default relays
Loading

0.23.0

23 Mar 17:53
@dmotz dmotz

Choose a tag to compare

This version marks Trystero's biggest update since initial release. The internals have been completely rewritten with minimal changes to the public API. You'll find faster, more robust peering thanks to connection sharing and offer recycling behind the scenes. The test suite has been expanded and hardened and now tests server-side use too. Trystero also has a new public face at trystero.dev.

User-facing changes

  • Trystero is now split into scoped packages: @trystero-p2p/{nostr,mqtt,torrent,supabase,firebase,ipfs} plus @trystero-p2p/core. The root trystero package still defaults to Nostr.
  • trystero/<strategy> imports are now deprecated compatibility entry points; migrate to @trystero-p2p/<strategy> for non-default strategies.
  • joinRoom(config, roomId, onJoinError) is now joinRoom(config, roomId, callbacks). onJoinError moved to callbacks.onJoinError, and Nostr/Torrent’s old relay-reconnection flag moved into config.manualRelayReconnection.
  • joinRoom() gained a new admission-handshake layer via onPeerHandshake(peerId, send, receive, isInitiator) and handshakeTimeoutMs, so apps can accept or reject peers before they become visible to getPeers(), onPeerJoin(), actions, or media callbacks. You can use this to implement your own custom identity layer with crypto keys.
  • trickleIce is now a public config option and speeds up initial connections. Most strategies default to trickle ICE, while Torrent and IPFS keep it off unless explicitly enabled.
  • @trystero-p2p/core now exposes createStrategy and shared types/utilities, making custom signaling strategies a supported extension point. You can use this to run a signaling relay for Trystero on any software you want. The readme shows a basic example using a simple WebSocket server.
  • Media and event ergonomics improved: replaceTrack() can now send metadata, onPeerJoin() immediately replays already-active peers to late listeners, and the action name limit increased from 12 bytes to 32 bytes.
  • Firebase’s getOccupants() helper was removed. This was only used by a single strategy and removing it helps keep the API surface small. You can still replicate its functionality with the Firebase API directly.
  • Server-side use is now a more explicit part of the public surface: rtcPolyfill is documented/tested, and a recommended polyfill library endorsement for werift.

Performance and reliability notes

  • Peer connection reuse is the biggest runtime change: when the same remote peer appears in multiple rooms, Trystero now reuses a shared underlying RTCPeerConnection instead of renegotiating per room.
    Offer pooling/reuse was overhauled, especially for tracker-style signaling, so old offers can be reclaimed and recycled instead of constantly allocating fresh peer connections.
  • Large and binary sends are more resilient under backpressure, with fixes for stalled sends and related data-channel hangs.
  • Relay robustness new public relay lists and better handling of repeated pings/timeouts, which should reduce churn and improve matchmaking stability.

Please share feedback, ideas, and of course, what you build with Trystero, via GitHub discussions/issues. Go forth and build a decentralized web. 🀝

Loading
jeremyckahn reacted with hooray emoji rogersanick, jeremyckahn, jamsinclair, jjmhalew, vrtmrz, Kiriller12, and ericsharma reacted with heart emoji
7 people reacted

0.22.0

11 Oct 20:56
@dmotz dmotz

Choose a tag to compare

Breaking changes

  • πŸͺ IPFS - removed libp2pConfig config option

Improvements

  • 🐦 Nostr and 🌊 BitTorrent - new manualRelayReconnection boolean flag in config object, which will disable Trystero's automatic relay socket reconnection behavior. This is paired with two top level package exports pauseRelayReconnection() and resumeRelayReconnection(), which allows you to control when Trystero auto-reconnects sockets. Additionally, Trystero will no longer attempt to reconnect sockets when the browser appears to be offline. Thanks to @vrtmrz for implementing.
  • πŸͺ IPFS - updated strategy, now reliably working and passing test suite

Contributors

vrtmrz
Loading
vrtmrz and prnthh reacted with hooray emoji
2 people reacted

0.21.8

03 Sep 23:47
@dmotz dmotz

Choose a tag to compare

  • The default bundle size is now 20% smaller, down to 8K minified 🀏
  • 🐦 Nostr - updated default relays
Loading
freehuntx and AlessioCoser reacted with thumbs up emoji
2 people reacted

0.21.7

19 Aug 03:21
@dmotz dmotz

Choose a tag to compare

  • Improved reconnection rates when leaving and rejoining rooms, thanks to @jeremyckahn
  • Improved type definitions

Contributors

jeremyckahn
Loading
mrdoob, jeremyckahn, satoLG, freehuntx, rogersanick, and worldpeaceenginelabs reacted with heart emoji
6 people reacted

0.21.4

25 May 19:06
@dmotz dmotz

Choose a tag to compare

Improvements

  • Improved WebRTC connection logic in core peer module β€” this should improve connection success rates
  • Default bundle size (Nostr) is now 40% smaller
Loading
openconstruct and andre-dietrich reacted with thumbs up emoji gzuuus, satoLG, worldpeaceenginelabs, and vhbui02 reacted with heart emoji
6 people reacted
Previous 1 3
Previous

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /