RustDesk Server Program https://rustdesk.com/server
  • Rust 89.5%
  • NSIS 3.5%
  • JavaScript 2.9%
  • Shell 2.8%
  • Dockerfile 0.4%
  • Other 0.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
RustDesk 680b60395e
fix(hbbr): match IPv4 clients against the relay lists in their IPv4 form (#748)
* Match IPv4 clients against the relay lists in their IPv4 form

hbbr listens dual-stack by default, so a direct IPv4 client reaches
relay() as ::ffff:a.b.c.d. relay() checked BLACKLIST and BLOCKLIST with
that form, while the lists hold the plain IPv4 that `ba` and `Ba` are
given. A blacklisted IPv4 client was therefore never throttled, and
adding it to the blocklist did not end its session. handle_connection
already normalizes with try_into_v4 for its accept-time check; relay()
now does the same.

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

* Keep IPv4-mapped list entries matching in relay()

The previous commit looked the lists up in the plain IPv4 form only, so
an entry in the ::ffff:a.b.c.d form stopped matching. That is the form
`usage` and the pairing logs print, so an admin copying an address from
them, or an existing list file holding one, lost the throttle and the
mid-session blocklist check. relay() now matches either form.

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

* Match either form of an IPv4-mapped client at accept too

handle_connection checked the blocklist in plain IPv4 form only, so an
entry in the ::ffff: form, the one usage prints, let the client connect.
If that client was the leg parked first, relay() never checks it and the
whole session ran. It now matches either form, as relay() does.

The relay() test gains a client that is not listed, which must outlive
the first list check, and a new test covers the accept check.

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

* Require a timeout in the list tests' unlisted cases

An unlisted client passed if relay() or the connection ended with an
error, not only if it stayed up until the timeout. Each case now names
the one outcome it expects.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 15:33:32 +08:00
.cargo crt-static 2023-02-16 15:23:31 +08:00
.github Delete .github/dependabot.yml 2026-08-07 16:56:36 +08:00
.vscode clippy 2023-02-08 16:45:30 +08:00
debian bump version 2026-07-23 20:13:48 +08:00
docker Bump S6 overlay and fix env warnings (#472) 2024-09-28 23:33:47 +08:00
docker-classic define the HOME env to allow running rootless (#612) 2025-11-22 15:20:15 +08:00
docs Bound message sizes on hbbs and hbbr (#747) 2026-11-07 13:24:28 +08:00
kubernetes chore: Added kubernetes example file (#623) 2026-01-06 17:58:33 +08:00
libs Git submodule: Bump libs/hbb_common from 5438d20 to 69cea8d (#687) 2026-07-27 09:43:51 +08:00
rcd Add description of relay server variable for clarity (#378) 2024-02-27 21:44:56 +08:00
src fix(hbbr): match IPv4 clients against the relay lists in their IPv4 form (#748) 2026-11-08 15:33:32 +08:00
systemd fix naming 2023-07-06 00:50:11 +08:00
tests Update protobuf to 3.7.2 (#684) 2026-07-23 18:46:09 +08:00
ui bump version 2026-07-23 20:13:48 +08:00
.env missed files 2022-05-12 20:07:45 +08:00
.gitattributes change sled to sqlite and remove lic 2022-05-12 20:00:33 +08:00
.gitignore Add Simplified Chinese Readme File. (#409) 2024-04-24 19:04:02 +08:00
.gitmodules replace libs/hbb_common with submodule (#502) 2025-01-20 17:34:22 +08:00
AGENTS.md bind interface and refactor doc 2026-07-24 10:56:56 +08:00
build.rs crt-static 2023-02-16 15:23:31 +08:00
Cargo.lock Bound message sizes on hbbs and hbbr (#747) 2026-11-07 13:24:28 +08:00
Cargo.toml Bound message sizes on hbbs and hbbr (#747) 2026-11-07 13:24:28 +08:00
db_v2.sqlite3 bind interface and refactor doc 2026-07-24 10:56:56 +08:00
docker-compose.yml Use same volumes for hbbs and hbbr 2022-07-21 16:45:06 +02:00
LICENSE Create LICENSE 2022-05-12 22:11:06 +08:00
README.md bind interface and refactor doc 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