rustdesk client

最後更新: 2024-08-21

目錄

 


EXE client usage

 

Extract Directory

# 此 Folder 66M

%LocalAppData%\rustdesk

  • librustdesk.dll           # 31M
  • flutter_windows.dll    # 17M

Config & Log Location

%AppData%\RustDesk

Force to use relay server

ID/r

查看 Host 及 Key

Settings > About

Get ID

rustdesk_id=$(rustdesk --get-id)

Set PW

rustdesk --password $rustdesk_pw

Put config in rustdesk.exe file name

Change "rustdesk.exe" to

"rustdesk-host=<host-ip-or-name>,key=<public-key-string>,.exe"

Notes

 * Optionally add a "," (comma) character after the key

 * If there are invalid characters in the id_ed25519.pub => 重試到正常為止

Server log

Signal Server (hbbs)

第一次 connect 時會有 log

... INFO [src/peer.rs:102] update_pk 134292276 [::ffff:R.R.R.R]:53595 b"?-?-?-?-?" b".."

當同一個 Client reset ID 時就會多一句

... INFO [src/peer.rs:130] pk updated instead of insert

再開 exe 也不會有 log

Relay Server (hbbr)

client 之間的連線係不會有 hbbs(signalserver) 的 log

relayserver.log

... New relay request UUID1 from [::ffff:R1.R1.R1.R1]:N2
... Relayrequest UUID2 from [::ffff:R2.R2.R2.R2]:N2 got paired
... Both are raw
  • 這裡的 UUID 不是 Clieck 的 ID
  • Relayrequest 係發起連線的一方. New relay request 係被連的一方
  • 是否成功連接是沒有 log 的 (所以是不知是否 Login 成功)

關 exe (remote control disconnet)

 * 不論誰先關閉 exe, 也會是 log 發起方的 IP

... Relay of [::ffff:R2.R2.R2.R2]:N2 closed

 


Quick Support

 

qs.exe    # -qs-

執行時會立即要求提升權限

 


Client Opts

 

# Show with defaut value

enable-tunnel=Y

allow-remote-config-modification=Y

enable-lan-discovery=Y

direct-server=N

whitelist=<ip1>,<ip2>,<ip3>

allow-remove-wallpaper=N

disable-udp=N

Controls whether to use TCP only. It will not use UDP 21116 any more, TCP 21116 will be used instead.

privacy-mode=N

black screen

 


Hardcode Client Settings

 

"Basic Self-hosting Pro Plan" 有 Custom client generator    # $240/yr

它有其他 hardcode settings. e.g. UI 沒有 "Remote Control Desktop"

Hardcode Settings(ENV)

RustDesk will use those variables when compiling your client

System > Advanced system settings > Advanced > Environment Variables

  • RENDEZVOUS_SERVER      # e.g. rustdesk.my-domain.com
  • RS_PUB_KEY                     # STRING
  • API_SERVER                     # https://xxx

Build 的測試環境

  • Rustdesk Client 1.27                         # Step 9
  • RUST_VERSION: 1.80.1                    # Step 2, 9
  • LLVM_VERSION: 15.0.6                    # Step 5
  • FLUTTER_VERSION: 3.16.9               # Step 6
  • VCPKG_COMMIT_ID: "2024.04.26"    # Step 7

OS 設定

# 打開 "Developer Mode"

start ms-settings:developers

詳見 github 上的 workflows

.github/workflows/flutter-build.yml

Build 的過程

1) 安裝 Microsoft C++ Build Tools

https://visualstudio.microsoft.com/visual-cpp-build-tools/

在 Workloads 內選 "Destktop development with C++"

在 Installation details 的 Optional 內選 (rustdestk 1.27)

  • MSVC v143 - VS 2022 C++
  • Windows 11SDK
  • C++ Cmake tools
  • C++ AddressSanitizer

2) 安裝 Rust develop environment

# 要安 VisualStudio 後再安裝它

https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe

# 會安裝到 %userprofile%\.cargo 及 %userprofile%\.rustup

%userprofile%\.cargo\bin\rustc.exe -V

rustc 1.80.1 (3f5fd8dd4 2024-08-06)

3) Install git

# Git-2.46.0-64-bit

https://git-scm.com/download/win

4) 安裝 python

https://www.python.org/ftp/python/3.12.5/python-3.12.5-amd64.exe

5) Install LLVM

# rust-bindgen depends on clang

# clang 64 bit

https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.6/LLVM-15.0.6-win64.exe    # 277M

6) 安裝 flutter

https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_3.16.9-stable.zip

解壓到 c:\source\flutter

7) Download vcpkg, install libvpx, libyuv and opus

# In Git Bash to run below cmd

mkdir c:\source
cd c:\source

git clone https://github.com/microsoft/vcpkg
cd vcpkg
git checkout 2024.04.26

cd ..
vcpkg/bootstrap-vcpkg.bat
export VCPKG_ROOT=$PWD/vcpkg

vcpkg/vcpkg install libvpx:x64-windows-static
vcpkg/vcpkg install libyuv:x64-windows-static
vcpkg/vcpkg install opus:x64-windows-static
vcpkg/vcpkg install aom:x64-windows-static

Notes

要用 "2024.04.26" 去 build libvpx, yuv, opus, aom

8) Add System Environment Variable

System > Advanced system settings > Advanced > Environment Variables

VCPKG_ROOT=C:\source\vcpkg

LIBCLANG_PATH=C:\Program Files\LLVM\bin

Path

  • C:\Users\admin\.cargo\bin
  • C:\source\flutter\bin
  • C:\source\vcpkg
  • C:\Program Files\Python312                   # python
  • C:\Program Files\Python312\Scripts        # pip

9) Build EXE

Run > powershell

cd c:\source
git clone https://github.com/rustdesk/rustdesk.git
pushd rustdesk
git checkout 1.2.7

Build the flutter version of the RustDesk

# Install flutter rust bridge deps

cargo install flutter_rust_bridge_codegen --version 1.80.1 --features "uuid"

Push-Location flutter ; flutter pub get ; Pop-Location

Run flutter rust bridge

~/.cargo/bin/flutter_rust_bridge_codegen --rust-input ./src/flutter_ffi.rs --dart-output ./flutter/lib/generated_bridge.dart

python .\build.py --portable --skip-portable-pack --hwcodec --flutter --vram

mv ./flutter/build/windows/x64/runner/Release ./rustdesk

10) 打包 exe

pushd ./libs/portable

pip3 install -r requirements.txt

# python ./generate.py -f ../../rustdesk/ -e ../../rustdesk.exe

python ./generate.py -f ../../rustdesk

會打包在 C:\source\rustdesk\target\release\rustdesk-portable-packer.exe

其他步驟

 * Sign rustdesk files
 * Sign rustdesk self-extracted file

 


Changelog Summary

 

1.3.1(Sep 26)

  • one-way-clipboard-redirection / one-way-file-transfer
    (Disable clipboard sync from controlled side to controlling side)
  • sync-init-clipboard (only from controlling side to controlled side)
  • allow-logon-screen-password
    (If allow password input on logon screen when click-only approve mode is used)
    (approve-mode: Accept incoming connections via password or manually click.)

1.3.0(Aug 19)

  • Multi clipboard formats, html/rtf (#8733)
  • Send clipboard keystroke (#5451)
    (Typing clipboard content)
    (without leaking the password to the user via their clipboard)
  • Active tab border (#8832)
  • Add client to address book/tag via command line (#7866)
  • Unlock with pin (#7656)
    (Password unlocking Network, Security settings)
  • Trust this device option for 2FA (#8513)
  • Rename File and Folder in file transfer window (#7758)
  • MSI options of creation of desktop and start menu shortcuts (#8829)
  • Universal apk, ARM64 / ARM32 / X86_64 (#8941)

1.2.7 (Jul 23)

  • Shared image of clipboard
  • Loading window for portable Windows

1.2.6 (Jun 23)

  • remove desktop wallpaper

 

Creative Commons license icon Creative Commons license icon