前情提要:本人专业大部分时间在机房,想把机房电脑当做自己电脑的副屏使用,但是接HDMI/DP线太麻烦,希望有方便快速的方法能通过公网实现屏幕串流
使用JiYuTrainer解除机房电脑的控制
RustDesk自建部署#
RustDesk官方服务端不带API服务器和Web Console(需要Pro)、不支持WebSocket连接,还有诡异的客户端连接超时问题,使用lejianwen/rustdesk-server作为替代,这是一个功能齐全的fork分支
使用docker compose文件部署在自己的vps上即可
Mac扩展屏设置#
使用BetterDisplay创建虚拟显示器
并在系统设置中调整好排列
然后在其他设备连接你的电脑时就可以选择串流虚拟显示器的内容
在Windows上一键启动客户端#
嗯,毕竟每节课的机房都不一样,而且有还原,不能在每台电脑上都安装rustdesk客户端并配置好,既不安全又麻烦
参考了一些RustDesk部署的笔记,先在自己的windows设备上配置好rustdesk,调整好设置,确认可以连接到电脑
然后在%appdata%\RustDesk\config
目录下复制RustDesk_default.toml
、RustDesk_local.toml
、RustDesk2.toml
这三个文件出来,按照需求删改一下
示例:RustDesk_default.toml
[options]
view_style = 'adaptive'
show_remote_cursor = 'Y'
show_quality_monitor = 'Y'
show_monitors_toolbar = 'Y'
zoom-cursor = 'Y'
image_quality = 'low'
RustDesk_local.toml
remote_id = '<remote_id>'
kb_layout_type = ''
size = [
0,
0,
0,
0,
]
fav = []
[options]
enable-check-update = 'N'
remote-menubar-drag-right = '1.0'
user_info = '{"name":"admin","status":1}'
enable-udp-punch = 'Y'
access_token = '<access_token>'
remote-menubar-drag-left = '0.0'
enable-ipv6-punch = 'Y'
RustDesk2.toml
rendezvous_server = '<id/中继服务器rendezvous_server>'
nat_type = 2
serial = 0
unlock_pin = ''
trusted_devices = ''
[options]
key = '<key>'
allow-websocket = 'Y'
custom-rendezvous-server = '<id/中继服务器rendezvous_server>'
allow-remote-config-modification = 'Y'
然后写个简单的脚本即可
目录结构:
➜ ls --tree
./ 224 B 7 hours ago
├── launch.cmd* 251 B 7 hours ago
├── RustDesk_default.toml* 154 B 7 hours ago
├── RustDesk2.toml* 276 B 7 hours ago
├── RustDesk_local.toml* 749 B 7 hours ago
└── rustdesk-1.4.2-x86_64.exe* 22 MB 9 hours ago
launch.cmd
mkdir "%APPDATA%\RustDesk\config"
copy RustDesk_local.toml %appdata%\RustDesk\config
copy RustDesk2.toml %appdata%\RustDesk\config
copy RustDesk_default.toml %appdata%\RustDesk\config
rustdesk-1.4.2-x86_64.exe "rustdesk://connection/new/123456789"
最终效果如下: