跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[Cloudflare] 使用 Cloudflare Tunnel 实现 VNC 远程桌面的正确姿势是什么?

发表于

我在 Cloudflare 购买了一个域名,想使用一台 Macbook 远程桌面到家里的 Mac mini 来使用,网上翻了很多帖子,说用 Tunnel 可以实现内网穿透,于是折腾了下,下面是具体的步骤:

使用家里的 Mac mini ,作为服务端操作如下:

1 、在 Cloudflare 控制台选择 Zero Trust 新建一个 Tunnel ,并选择 Cloudflared 类型的 Connector ;

2 、在 Public Hostname Page 中设置了 Subdomain 、Domain 参数,Service 选择了 RDP ,URL 设置为 localhost:3389

3 、在 Install and run a connector 的页面,复制安装命令并运行:

brew install cloudflared && 
sudo cloudflared service install eyJhIjoiNGNxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

4 、运行完成后,在 Your tunnels 页面能显示出 Connectors 连接成功。

然后使用 Macbook 作为远程桌面的客户端,同样使用 brew 安装好了 cloudflared ,并运行如下命令:

cloudflared access rdp --hostname xxx.xxx.com --url rdp://localhost:3389

输出日志显示启动成功:

INFO Start Websocket listener host=localhost:3389

然后我使用访达的前往服务器功能,输入:vnc://127.0.0.1:3389进行连接,连接失败,并有如下日志输出:

ERR failed to connect to origin error="websocket: bad handshake" originURL=https://xxx.xxx.com

检查了两台 Mac 的防火墙均处于关闭状态,google 了上面的错误日志看到有说是 Cloudflare 的网络设置中没有打开 WebSocket 导致,也检查了一下是默认开启的,现在不太确定是哪里的问题,不知道有没有小伙伴有成功的案例,不胜感激。

Featured Replies

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.