# PeerConnect > End-to-end encrypted, reliable channels between exactly two applications, through an untrusted and stateless WebSocket relay. PeerConnect is offered as an API: the relay protocol, and an HTTP API that issues the tokens the public relay requires. There is no SDK to install: implement the peer side of the specification in your application. Key facts: - Public relay: `wss://relay.peerconnect.dev`. Endpoint: `wss://relay.peerconnect.dev/v1/?token=`. Frames are binary WebSocket messages; keepalive is the text `ping` every 25 s, answered by `pong`. - Every connection needs a token, each peer its own; tokens are never part of an invite. Close code 4403: the token is missing, invalid or revoked; get a new one before reconnecting. 4429: too many connections; wait at least 60 s. - Tokens: `POST https://peerconnect.dev/api/trial` (two hours, no account, for trying out); for an application, register it at https://peerconnect.dev/developers for an app ID and an app secret, then either Connect with PeerConnect (OAuth 2.0 authorization code with PKCE: `https://peerconnect.dev/connect`, then `POST https://peerconnect.dev/api/token`) or have your server call `POST https://peerconnect.dev/api/apps//tokens` with the app secret. - Cryptography: Ed25519 (room IDs are public keys derived from the room secret; relays admit by challenge signature), the Noise handshake `Noise_IKpsk1_25519_ChaChaPoly_SHA256`, ChaCha20-Poly1305, SHA-256 and HMAC-SHA256, unpadded base64url everywhere. - A client must reproduce the test vectors in `test-vectors/v1.json` exactly before it talks to anyone. ## Docs - [API reference](https://peerconnect.dev/docs/api.md): tokens on the relay, trial tokens, Connect with PeerConnect, server-issued tokens, errors. - [Protocol specification v1](https://peerconnect.dev/spec.md): rooms and invites, relay frames and admission, the handshake, the reliable stream, close codes, limits and timers, security considerations. Normative. - [Guide](https://peerconnect.dev/docs): concepts, getting access, running your own relay, limits, security checklist. - [Full text](https://peerconnect.dev/llms-full.txt): the API reference and the specification in one file. ## Reference implementations For reading and testing against, not to install: they are the repository's own, not supported packages. Follow the specification where they differ. - [Rust core](https://github.com/atshelchin/peerconnect/tree/main/crates/peerconnect): the protocol without I/O. `src/peer.rs` is the peer state machine (connect, join, handshake, reliable stream, pairing, reconnection), `src/room.rs` rooms and invites, `src/noise.rs` the handshake, `src/wire.rs` frames and close codes; `src/client.rs` drives it with Tokio WebSockets. - [JavaScript](https://github.com/atshelchin/peerconnect/tree/main/js): the same Rust core compiled to WebAssembly, with `index.js` supplying the WebSocket and timers (about 200 lines): a template for driving the state machine from any event loop. - [Test vectors](https://github.com/atshelchin/peerconnect/tree/main/test-vectors): `v1.json`, and `verify.mjs`, an independent implementation of every derivation with node:crypto. ## Optional - [Live demo](https://peerconnect.dev/demo): two browsers pairing through the public relay. - [Relay](https://github.com/atshelchin/peerconnect/tree/main/crates/peerconnect-relay): the Linux relay, for running your own (`PEERCONNECT_TOKEN_SECRET` makes it require tokens).