RustDeskandClaude Opus 5.5 5e37f45dfe Fix/punch reqs bound (#713)
* fix(hbbs): bound the punch-request record store

PUNCH_REQS grew without limit; its dedupe scan only covers the newest 30
entries, so cycling 31 online peer ids from one source appended a record
per request for the lifetime of the process. Keep at most 10,000 entries,
evicting the oldest.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PkpVy2ufxgEjKd3SjXPnJ8

* feat(hbbs): make the punch-request record cap configurable

MAX_PUNCH_REQUESTS sets how many records the punch-requests console
command keeps (default 10000); 0 disables recording.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PkpVy2ufxgEjKd3SjXPnJ8

* fix(hbbs): cap peer id length at 253 bytes

RegisterPk accepted ids up to a whole UDP datagram, so 31 registered
peers with ~64 KB ids still let the bounded punch-request store reach
hundreds of MB. Reject longer ids in RegisterPk and RegisterPeer, the
same bound the Pro server uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PkpVy2ufxgEjKd3SjXPnJ8

* feat(hbbs): keep 100000 punch-request records by default

With peer ids capped at 253 bytes a full store is roughly 45 MB at
worst, so a larger default keeps more console history.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PkpVy2ufxgEjKd3SjXPnJ8

* test(hbbs): assert which punch-request records survive eviction

The length check alone passed if the newest record were evicted or new
records were dropped once full.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PkpVy2ufxgEjKd3SjXPnJ8

* test(hbbs): cover MAX_PUNCH_REQUESTS=0 in the punch-request test

At zero capacity the loop never ran and the new front/back asserts
unwrapped an empty queue. Make at least one request so the disabled
path is exercised, and only check eviction order when records are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PkpVy2ufxgEjKd3SjXPnJ8

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-10 16:51:29 +08:00
2023-02-16 15:23:31 +08:00
2026-08-07 16:56:36 +08:00
2023-02-08 16:45:30 +08:00
2026-07-23 20:13:48 +08:00
2026-10-10 16:51:29 +08:00
2026-10-10 16:51:29 +08:00
2023-07-06 00:50:11 +08:00
2026-07-23 18:46:09 +08:00
2026-07-23 20:13:48 +08:00
2022-05-12 20:07:45 +08:00
2026-07-24 10:56:56 +08:00
2023-02-16 15:23:31 +08:00
2026-07-23 20:13:48 +08:00
2026-07-23 20:13:48 +08:00
2026-07-24 10:56:56 +08:00
2026-07-24 10:56:56 +08:00
2022-05-12 22:11:06 +08:00
2026-07-24 10:56:56 +08:00

RustDesk Server Program

build

Download

Manual

Configuration & environment variables

FAQ

How to migrate OSS to Pro

Self-host your own RustDesk server, it is free and open source.

Important

Need more features? RustDesk Server Pro might suit you better.

Want to develop your own server? Start with rustdesk-server-demo, a simpler starting point than this repository.

How to build manually

cargo build --release

Three executables will be generated in target/release.

  • hbbs - RustDesk ID/Rendezvous server
  • hbbr - RustDesk relay server
  • rustdesk-utils - RustDesk CLI utilities

You can find updated binaries on the Releases page.

Configuration

hbbs and hbbr can be configured with command-line flags, environment variables, or an .env / config file. Run hbbs --help or hbbr --help to see the available flags.

The most common options:

Option Flag Env var Applies to Purpose
Key -k KEY hbbs, hbbr hbbs loads/generates one by default
Bind address -b BIND hbbs, hbbr Local IP address to listen on (default: all interfaces; requires 1.1.17+)
Port -p PORT hbbs, hbbr Listening port (hbbs 21116, hbbr 21117)
Relay servers -r RELAY-SERVERS hbbs Override when the relay uses a different address or a non-standard port
Force relay — ALWAYS_USE_RELAY hbbs Y disables direct connections
Log level — RUST_LOG hbbs, hbbr e.g. debug (default info)

See docs/environment-variables.md for the full list of variables, the file/flag/env precedence rules, database and relay bandwidth tuning, Docker image variables, and examples.

Installation

Please follow this doc

S
Description
RustDesk Server Program
Readme AGPL-3.0
3.7 MiB
Languages
Rust 88.3%
NSIS 3.9%
JavaScript 3.3%
Shell 3.1%
Dockerfile 0.5%
Other 0.9%