Skip to content
xtr-devPublic

About

Peer-to-peer connections for agent-built apps: WebRTC SDK with end-to-end verified identities

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

Rondevu

Rondevu lets apps connect to each other directly, peer-to-peer, from any machine: a laptop behind a home router, a CI runner, a browser tab. An app calls serve(), hands out an invite link, and clients call connect(). Data flows over WebRTC between the two peers; the Rondevu service only introduces them.

It is built for apps that are written and run by coding agents, which need a way to let other people or programs reach what they just built without deploying it or opening ports.

Status: alpha. This is a rewrite of the earlier @xtr-dev/rondevu-client (0.x). The API is not compatible with 0.x, and the hosted service does not run this version yet.

Quick start

npm install @xtr-dev/rondevu-client
npm install @roamhq/wrtc   # only in Node; browsers have WebRTC built in

Sign in and set the app's directory up, once:

npx @xtr-dev/rondevu-cli login    # approve in your browser
npx @xtr-dev/rondevu-cli init     # creates a project and writes .rondevu/

Host an app (Node 22+):

import { serve } from '@xtr-dev/rondevu-client';
import { loadConfig } from '@xtr-dev/rondevu-client/node';

// loadConfig() reads the project id, secret key and host identity that `init` put in .rondevu/
const host = await serve({ ...(await loadConfig()), app: 'my-app' });   // any app name; clients connect to it

host.on('connection', (connection) => {
  console.log('connected:', connection.peer);          // the client's verified public key
  connection.on('message', (data) => connection.send(`echo ${data}`));
});

const { link } = await host.invite({ ttlSeconds: 3600 });
console.log('Share this link:', link);

Connect to it (Node or browser):

import { connect } from '@xtr-dev/rondevu-client';

const connection = await connect(link);
connection.on('message', (data) => console.log(data));
connection.send('hello');

For coding agents

The CLI doubles as an MCP server, so an agent can sign in (with a person approving in their browser), set a project up and create invite links by calling tools. Its docs tool returns a guide written for agents. See packages/cli.

claude mcp add rondevu -- npx -y @xtr-dev/rondevu-cli mcp

Who can connect

A host chooses how clients are admitted:

access Who the service introduces to the host
token (default) Only clients holding an invite created by host.invite() or createConnectToken().
public Anyone who has host.link.

On top of that, a host can pass authorize: (peer) => boolean to accept or refuse each client by its public key. That check runs on the host itself, after the client's identity has been verified.

Security model

  • Every peer has an Ed25519 identity. Its public key is its address.
  • When two peers set up a connection, each signs the fingerprint of the certificate it will use for the encrypted WebRTC connection. The other side verifies that signature before connecting.
  • An invite link contains the host's public key, so a client that connects through a link only accepts that exact host. Neither the signaling service nor a relay can read, alter or impersonate the traffic.
  • A client that calls connect() with a project and app but no hostKey trusts the service to introduce an honest host. Use links, or pass hostKey, whenever that matters.
  • The project secret key (rdv_sk_...) lets its holder host apps in the project. Keep it on the host; never ship it to clients or browsers.

API

serve(options) Registers a host and resolves to a Host. Reconnects to the service on its own.
host.invite({ ttlSeconds }) Creates an invite link (default lifetime 24 hours).
host.link Link without a token, for public apps.
host.on('connection' | 'signaling' | 'error', ...) New client; link to the service went down or came back; host stopped for good.
connect(link) / connect(options) Resolves to a Connection once it is open and verified.
connection.send(data) Sends a string or binary message, reliably and in order.
connection.drained() Await between sends when streaming, so the send buffer stays bounded.
connection.on('message' | 'close', ...) Incoming data; the connection ended.
connection.peer The other side's verified public key.
createConnectToken({ apiKey, app }) For backends: issues a connect token over HTTPS.
getUsage({ apiKey }) Relay usage and allowance of the project's organisation for the current month.
loadConfig(dir?) From @xtr-dev/rondevu-client/node: the project, secret key and identity set up by rondevu init, ready to spread into serve().
loadOrCreateIdentity(path) From @xtr-dev/rondevu-client/node: a persistent identity, stored owner-readable only.

Failed calls reject with a RondevuError whose code says why: unauthorized, no_host, rejected, untrusted_peer, timeout, failed, and others listed in src/errors.ts.

Direct and relayed connections

Peers connect directly whenever their networks allow it. When they do not, traffic goes through the Rondevu relay, still encrypted end-to-end. Relayed traffic counts against the organisation's monthly allowance; once that is used up, new sessions are no longer offered the relay and only direct connections succeed. Pass relayOnly: true to serve() or connect() to always use the relay, which hides your IP addresses from the other peer.

A dropped connection is not re-established automatically: listen for close and call connect() again.

Packages

Package
packages/client The SDK, @xtr-dev/rondevu-client.
packages/cli The rondevu command line and MCP server, @xtr-dev/rondevu-cli.
packages/protocol Wire messages and signing rules shared with the service. See docs/protocol.md.

Development

npm install
npm test        # builds the packages and runs the protocol unit tests

The end-to-end tests need the signaling service and live with it.

License

MIT

About

Peer-to-peer connections for agent-built apps: WebRTC SDK with end-to-end verified identities

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages