# rustdesk Open source virtual / remote desktop infrastructure for everyone! The open source TeamViewer alternative. Display and control your PC and Android devices from anywhere at anytime. ## Develop 包含服务端和client **pc 客户端**,Desktop versions use Sciter for GUI ``` git clone https://github.com/microsoft/vcpkg cd vcpkg git checkout 2023.04.15 cd .. vcpkg/bootstrap-vcpkg.bat export VCPKG_ROOT=$PWD/vcpkg vcpkg/vcpkg install libvpx:x64-windows-static libyuv:x64-windows-static opus:x64-windows-static aom:x64-windows-static git clone https://github.com/rustdesk/rustdesk cd rustdesk mkdir -p target/debug wget https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.win/x64/sciter.dll mv sciter.dll target/debug cargo run ``` **Android:** 需要ndk,flutter,Rust,https://rustdesk.com/docs/en/dev/build/android/ ``` # 编译生成 generated_bridge cd rustdesk git clone https://github.com/rustdesk/rustdesk sudo apt install ca-certificates -y sudo apt update -y sudo apt install -y g++ gcc git curl wget nasm yasm libgtk-3-dev clang cmake libclang-dev ninja-build llvm-dev libclang-10-dev llvm-10-dev pkg-config cargo install flutter_rust_bridge_codegen pushd flutter && flutter pub get && popd ~/.cargo/bin/flutter_rust_bridge_codegen --rust-input ./src/flutter_ffi.rs --dart-output ./flutter/lib/generated_bridge.dart # 编译flutter项目 sudo apt update -y sudo apt-get -qq install -y git curl wget nasm yasm libgtk-3-dev clang libxcb-randr0-dev libxdo-dev libxfixes-dev libxcb-shape0-dev libxcb-xfixes0-dev libasound2-dev libpulse-dev cmake libclang-dev ninja-build libappindicator3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libvdpau-dev libva-dev libclang-dev llvm-dev libclang-10-dev llvm-10-dev pkg-config tree g++ libc6-dev gcc-multilib g++-multilib openjdk-11-jdk-headless dart pub global activate ffigen 5.0.1 pushd /opt sudo wget https://github.com/rustdesk/doc.rustdesk.com/releases/download/console/dep.tar.gz sudo tar xzf dep.tar.gz popd ``` **服务端:** * hbbs- RustDesk ID/Rendezvous 服务器 * hbbr- RustDesk 中继服务器 开放端口: TCP(21115、21116、21117、21118、21119) UDP ( 21116 ) 其中hbbs侦听 21115 (TCP)、21116 (TCP/UDP) 和 21118 (TCP),hbbr侦听 21117 (TCP) 和 21119 (TCP) 服务器配置: 2核4G内内存 https://github.com/rustdesk/rustdesk-server/releases/latest https://rustdesk.com/docs/en/self-host/rustdesk-server-oss/install/ release 下载, ``` ufw allow proto tcp from YOURIP to any port 22 ufw allow 21115:21119/tcp ufw allow 8000/tcp ufw allow 21116/udp sudo ufw enable wget https://raw.githubusercontent.com/techahold/rustdeskinstall/master/install.sh chmod +x install.sh ./install.sh ./hbbs -r ./hbbr hbbs.example.com:21116 ``` 或者docker安装: ``` version: '3' services: hbbs: container_name: hbbs image: rustdesk/rustdesk-server:latest command: hbbs volumes: - ./data:/root network_mode: "host" depends_on: - hbbr restart: unless-stopped hbbr: container_name: hbbr image: rustdesk/rustdesk-server:latest command: hbbr volumes: - ./data:/root network_mode: "host" restart: unless-stopped ``` 启动服务: ``` docker compser -d up # 查询key并记录 cat ·/data/id_xx.pub docker logs -f hbbs ``` 然后在客户端配置服务器地址和Key