CloudflareTunnel代理访问服务器数据库
153 字
1 分钟
CloudflareTunnel代理访问服务器数据库
起因服务器在国外,ip直连总是遇到各种各样的问题,于是干脆用Cloudflare Tunnel通过域名方式来连接数据库。
# ===== xxx =====# description: rn135ssh.example.top manual entry# environment: development# tags: manual,rn135ssh# location: 1Panel# created_at: 2026-03-23 15:15:46# updated_at: 2026-03-23 15:15:46Host rn135ssh HostName rn135ssh.example.top User root IdentityFile C:\Users\Root\.ssh\dell ProxyCommand "C:/Users/Root/AppData/Local/Microsoft/WinGet/Packages/Cloudflare.cloudflared_Microsoft.Winget.Source_8wekyb3d8bbwe/cloudflared.exe" access ssh --hostname %h去除每次都要输入passphrase验证:
Set-Service ssh-agent -StartupType AutomaticStart-Service ssh-agentssh-add C:\Users\Root\.ssh\dell安装cloudflare:
winget install --id Cloudflare.cloudflared设置连接:
cloudflared access tcp --hostname db.postgres-xxx.example.top --url 127.0.0.1:154332026-03-23T06:37:04Z INF Start Websocket listener host=127.0.0.1:15433即可localhost:15433访问数据库

踩坑:
-
开启了虚拟网卡代理
-
罪魁祸首,域名起的太花了=-=

image-20260324092839714
文章分享
如果这篇文章对你有帮助,欢迎分享给更多人!
CloudflareTunnel代理访问服务器数据库
https://shaio.top/posts/dev/cloudflaretunnel代理访问服务器数据库/ 相关文章 智能推荐
1
win10 ltsc安装Affinity.msix等misx安装包
记录 win10 ltsc安装Affinity.msix等misx安装包
2
MoGallery-GitHub Actions跨平台打包
Dev MoGallery Desktop 使用 GitHub Actions 构建 Windows、macOS 和 Linux 安装包的配置记录
3
存储整理列表滚动空白:44px 的格子不该拉原图
MO Gallery 后台「存储整理」快速滚动时整片空白的根因与修复——缩略图地址、虚拟化,以及 Web / Desktop 两端各自的取舍
4
本机和服务器的 SSH 管理
运维 2026-10-16
5
Emulsion Desktop 窗口闪屏与实时缩放修复:从关闭 DirectComposition 到 BufferQueue
MO Gallery 复盘 Wails v3 与 WebView2 在透明 Acrylic 窗口中出现的缩放后首次悬停闪屏、磨砂退化和拖拽空白,记录原生采样、方案对照与 BufferQueue 修复的验证边界。
随机文章 随机推荐