p2p-cljs.git
ird-p2p-cljs — ClojureScript peer SDK for the ird p2p service on Node.js (18+): rooms that find each other through the app's signaling relay, WebRTC data channels with TURN and the relay as fallback, end-to-end encryption, invite links, verified identities, and the offline mailbox. core.async channels end to end; a sibling of p2p-swift, byte-for-byte interoperable with it.
Use as a dependency
No registry — a source library served straight from this domain, consumed
as a git dependency (with shadow-cljs
reading deps.edn):
;; deps.edn
{:deps {ro.ird/ird-p2p-cljs {:git/url "https://ird.cod-sursa.ro/p2p-cljs.git"
:git/tag "v0.3.1" :git/sha "0000000"}
thheller/shadow-cljs {:mvn/version "3.5.0"}}}
The latest release is v0.3.1
(0000000). To pin that exact commit:
ro.ird/ird-p2p-cljs {:git/url "https://ird.cod-sursa.ro/p2p-cljs.git"
:git/sha "0000000000000000000000000000000000000000"}
Add ws to your package.json dependencies (the
default relay socket); ClojureScript and core.async come from
deps.edn. These coordinates are filled from
releases.json, which scripts and agents can read
directly (head, tag, tag_sha per repo).
Quickstart
(require '[cljs.core.async :refer [go
Every async call returns a core.async channel delivering one value — the
result or an ex-info error. The full guide — one API for the
/ws relay or libp2p, identity and invite links, the offline
mailbox, errors, origins for Node clients, WebRTC — is in the repo's
README.md; the end-to-end envelope format is in
PROTOCOL.md.
Clone
git clone https://ird.cod-sursa.ro/p2p-cljs.git
browse the source in your browser →
What's inside
src/ird/p2p.cljs— the public facade: make-app, join, send/broadcast, mailbox, identitysrc/ird/p2p/{crypto,envelope,identity}.cljs— HKDF derivations, sealed envelopes, Ed25519 identities and fingerprintssrc/ird/p2p/{transport,transport/ws,transport/libp2p}.cljs— the relay SPI, the/wsrelay, and the gossipsub adaptersrc/ird/p2p/{room,webrtc,descriptor,turn,mailbox,errors}.cljs— rooms, the pc-factory SPI and the in-memory factory, the descriptor, TURN, the mailboxsrc/ird/p2p/impl/— the only namespaces with JavaScript interop (WebCrypto, ws, fetch, libp2p, andimpl/wrtc: the optional real WebRTC factory over node-datachannel)test/— golden vectors, offline suites with fake transports, two real libp2p nodes (and a third as a circuit-relay hop) and two real data channels over loopback, the zero-interop gate, an env-gated live suitePROTOCOL.md— the SDK's end-to-end envelope specification
License
MIT.