This is a rustdesk HBBS/HBBR websocket implement with Durable Object
Setup worker secret HBBS_RELAY_URL = 'wss://your-worker-url' on cloudflare dashboard
Enable 'Use Websocket' on rustdesk Network setting, set ID/Relay Server to your-worker-url,
Set Api Server to https://localhost or https://your-worker-url to enable wss connection
Goto https://rustdesk.com/web/ set Network setting to your-worker-url, control your desk by web
Without this step the native client shows "Could not verify end-to-end encryption" on every connection. To get a verified session, give the worker its own Ed25519 key pair:
- Create the key pair (needs Node.js). Run this in the repo folder after
pnpm install, or in any empty folder afternpm install tweetnacl:
node -e "const n=require('tweetnacl');const k=n.sign.keyPair();console.log('PUBLIC (client Key field):');console.log(Buffer.from(k.publicKey).toString('base64'));console.log('SECRET (worker secret HBBS_SIGN_SK):');console.log(Buffer.from(k.secretKey).toString('base64'))"It prints a PUBLIC key (44 characters) and a SECRET key (88 characters). The two belong together.
- Store the SECRET key on the worker: Cloudflare dashboard, Compute (Workers & Pages), your worker,
Settings, Variables and Secrets, Add. Type
Secret, nameHBBS_SIGN_SK, value is the secret key. Save and deploy. - Store the PUBLIC key in every controlling RustDesk client: Settings, Network, ID/Relay server,
field Key (next to ID server, Relay server and API server). Paste it without spaces or line
breaks, confirm and restart RustDesk.
If
HBBS_SIGN_SKis not set, behaviour is unchanged. To replace the key pair later, repeat all three steps with a new pair; an old public key in a client no longer matches. Keep the secret private: anyone holding it can impersonate your server towards clients that have the matching public key.
First, run:
npm install
# or
yarn install
# or
pnpm install
# or
bun installThen run the development server (using the package manager of your choice):
npm run dev| Command | Action |
|---|---|
npm run deploy |
Deploy your application to Cloudflare |
npm wrangler tail |
View real-time logs for all Workers |