Self-hostable relay that lets the Alma desktop app be controlled from the Alma phone app over an outbound connection, without port forwarding or a VPN.
nanami-0713/relay-kit
A self-hostable, end-to-end encrypted relay that deploys to Cloudflare Workers, letting a phone reach a local desktop port without exposing it.
- Stars
- 194
- Forks
- 22
- Open issues
- 0
- Last commit
- 7 days ago
What is it?
relay-kit is a relay server that sits between a remote client, such as a phone, and a service running on a desktop. The relay runs on Cloudflare Workers with Durable Objects and only forwards ciphertext and a routing token, so decryption happens only at the two ends. Pairing uses a single 256-bit code that also derives the routing token and the PAKE salt, so without the code the relay cannot complete the handshake.
The repository includes the relay itself, a reference agent that proxies any local HTTP or WebSocket port, and a reference client exposing fetch and WebSocket over the tunnel. A Node-based relay fixture implements the same protocol for local testing or single-process self-hosting. The protocol is specified in PROTOCOL.md, and the core package uses only WebCrypto so it runs on Node 18+, browsers, and Capacitor WebViews.
The project is derived from the relay protocol of the Alma AI assistant and is not wire-compatible with Alma's official clients. It has no rate limiting out of the box, and the handshake is not formally audited.
Key features
- 01Deploys the relay to Cloudflare Workers with a single wrangler command.
- 02Relay only handles ciphertext and routing tokens; decryption happens at the endpoints.
- 03A single pairing code derives both the routing token and the PAKE salt.
- 04Reference agent proxies any local HTTP and WebSocket port.
- 05Core crypto package depends only on WebCrypto and runs on Node 18+ and browsers.
- 06Includes a Node relay fixture for local testing or self-hosting.
Use cases
- Reaching a local dev server or desktop web dashboard from a phone on another network.
- Self-hosting a private encrypted tunnel on your own Cloudflare account.
- Building a custom agent or client against the documented relay-e2e/v1 protocol.
Quick start
- 1
Install dependencies
npm install - 2
Log in to your Cloudflare account (one-time)
npx wrangler login - 3
Change into the relay server directory
cd workers/relay - 4
Deploy the relay to Cloudflare Workers
npx wrangler deploy
Things to know
- The handshake is a homegrown PAKE-style scheme that has not been formally verified or audited.
- The protocol is not wire-compatible with official Alma clients out of the box.
- workers.dev domains are blocked on many mainland China networks, so a custom domain or proxy may be needed.
In collections
Topics
FAQ
- What is relay-kit?
- A self-hostable, end-to-end encrypted relay that deploys to Cloudflare Workers, letting a phone reach a local desktop port without exposing it. relay-kit is a relay server that sits between a remote client, such as a phone, and a service running on a desktop. The relay runs on Cloudflare Workers with Durable Objects and only forwards ciphertext and a routing token, so decryption happens only at the two ends. Pairing uses a single 256-bit code that also derives the routing token and the PAKE salt, so without the code the relay cannot complete the handshake.
- Is relay-kit free to use? What license does it have?
- relay-kit is open source under the MIT license. Check the license terms before using it in commercial products.
- Is relay-kit still maintained?
- Actively maintained. The last commit to relay-kit was on Nov 1, 2026.
- What can I use relay-kit for?
- Reaching a local dev server or desktop web dashboard from a phone on another network. Self-hosting a private encrypted tunnel on your own Cloudflare account. Building a custom agent or client against the documented relay-e2e/v1 protocol.
- How do I install relay-kit?
- Install dependencies: npm install Log in to your Cloudflare account (one-time): npx wrangler login Change into the relay server directory: cd workers/relay Deploy the relay to Cloudflare Workers: npx wrangler deploy
- Where can I get relay-kit?
- The source code and installation instructions are on GitHub: https://github.com/nanami-0713/relay-kit
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A CLI that gives your local dev server a public HTTPS URL, with WebSockets and hot reload passing through, free and without an account.
A CLI tool that sends files and folders between any two computers, peer-to-peer with relay fallback and end-to-end encryption via a shared code phrase.
Self-hosted, open-source WebRTC platform for 1-to-1 cam-to-cam video calls with screen sharing and end-to-end encryption.
A git server where each repository is a Durable Object, running on Cloudflare Workers or self-hosted on celld.
A self-hosted daemon that runs Cloudflare Workers applications and Durable Objects on your own machines, with state stored in an S3, GCS, or Azure bucket.