TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Easy to Use Cloudflare Tunnels

32 点作者 eldridgea大约 3 年前

2 条评论

joshstrange大约 3 年前
I used CF tunnels just the other day for the first time and they are pretty freaking cool. I think some of the docs could be improved (as I was throughly confused by &quot;Applications&quot; and how they related to tunnels, turns out I did not want applications but they are cool for self-hosted things. I have my own SSO setup for my self-hosted but I might consider moving to CF Applications in the future).<p>I used to create my own ngrok-type service (for just myself). I think with a little more wrapping code I could have an almost feature-parity with ngrok using CF tunnels but I&#x27;m happy with where I have it now. I have 2 tunnels (1 for server, 1 for client) that expose my local dev environment on a hostname I own (and use CF for the DNS). In the package.json for the client and server I have a npm run command to spin up the tunnel so I just cd to the project directory and run `npm run cf-tunnel` and then I&#x27;m good to go.<p>Why did I do this? 2 things, Apple Pay&#x2F;Google Pay and HTTPS-gated things in general. Some things can work on localhost but a lot of things get fussy any want HTTPS even for development. Apple Pay needs you to validate a domain on HTTPS which means you either have to deploy and pray it works (yes, I have dev environments that are HTTPS but I hate adding so much turnaround time from &quot;writing code&quot;-&gt;&quot;testing feature&quot;) or find a way to get your local dev served over a consistent hostname+HTTPS. You can do this with ngrok (paid, reserved subdomain) but I so rarely need this that I didn&#x27;t love the idea of paying ~$60&#x2F;yr for something I would use a handful of times at best.<p>I could have just wired up another Caddy entry on my local server but I prefer being able to turn off the tunnels easily (just kill the running `npm run cf-tunnel`) so I&#x27;m only exposing my local dev when I want to.
watermelon0大约 3 年前
If anyone from CF is reading this, going to <a href="https:&#x2F;&#x2F;dash.teams.cloudflare.com&#x2F;&lt;id&gt;&#x2F;access&#x2F;tunnels&#x2F;add" rel="nofollow">https:&#x2F;&#x2F;dash.teams.cloudflare.com&#x2F;&lt;id&gt;&#x2F;access&#x2F;tunnels&#x2F;add</a>, typing name of the tunnel, and pressing Enter throws &#x27;Tunnel name is required&#x27; (at least on macOS Safari.)<p>Clicking on &#x27;Save tunnel&#x27; button works, but I was a bit baffled why it didn&#x27;t accept the names I tried at first.
评论 #30806115 未加载