<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Tunneling on Bruce AI 工程笔记</title><link>http://www.heyuan110.com/zh/tags/tunneling/</link><description>Recent content in Tunneling on Bruce AI 工程笔记</description><generator>Hugo</generator><language>zh</language><lastBuildDate>Sat, 04 Apr 2026 00:30:00 +0800</lastBuildDate><atom:link href="http://www.heyuan110.com/zh/tags/tunneling/index.xml" rel="self" type="application/rss+xml"/><item><title>内网穿透实战：SSH 隧道、frp、Cloudflare Tunnel 三种方案深度对比</title><link>http://www.heyuan110.com/zh/posts/ai/2026-04-04-cloudflare-tunnel-guide/</link><pubDate>Sat, 04 Apr 2026 00:30:00 +0800</pubDate><guid>http://www.heyuan110.com/zh/posts/ai/2026-04-04-cloudflare-tunnel-guide/</guid><description>&lt;p&gt;&lt;img src="http://www.heyuan110.com/posts/ai/2026-04-04-cloudflare-tunnel-guide/cover.webp"
 alt="内网穿透实战 — SSH 隧道、frp、Cloudflare Tunnel 三种方案深度对比"
 
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 width="1200"
 height="630"
/&gt;
&lt;/p&gt;
&lt;p&gt;上周碰到一个很常见的场景：海外同事要测一个我本地跑着的功能。我的 Mac Mini 在家里，藏在路由器的 NAT 后面，没有公网 IP，ISP 也没给固定地址。我总不能为了让人看一眼页面，就去折腾端口转发、暴露整个家庭网络吧。&lt;/p&gt;
&lt;p&gt;这个问题 —— 把 &lt;code&gt;localhost&lt;/code&gt; 暴露到公网 —— 在开发中高频出现。Webhook 回调、真机测试、跨国协作、客户演示……需求很普遍，但网络现实让它出奇地难搞。&lt;/p&gt;
&lt;p&gt;过去几年我在不同项目里用过三种方案，各有各的适用场景。这篇文章不是那种浅尝辄止的工具推荐，而是把每种方案的底层原理、完整搭建步骤、以及我实际踩过的坑全部摊开来讲。&lt;/p&gt;
&lt;h2 id="问题的本质为什么-localhost-无法被外部访问"&gt;问题的本质：为什么 localhost 无法被外部访问&lt;a href="#%e9%97%ae%e9%a2%98%e7%9a%84%e6%9c%ac%e8%b4%a8%e4%b8%ba%e4%bb%80%e4%b9%88-localhost-%e6%97%a0%e6%b3%95%e8%a2%ab%e5%a4%96%e9%83%a8%e8%ae%bf%e9%97%ae" class="anchor" aria-hidden="true"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
 stroke-linecap="round" stroke-linejoin="round"&gt;
 &lt;path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"&gt;&lt;/path&gt;
 &lt;line x1="8" y1="12" x2="16" y2="12"&gt;&lt;/line&gt;
 &lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;根源在 NAT（网络地址转换）。你的 ISP 给路由器一个公网 IP（运气差的话是 CGNAT 共享地址），路由器再给内网设备分配 &lt;code&gt;192.168.x.x&lt;/code&gt; 之类的私有地址。外部流量到达路由器时，路由器不知道该转给哪台设备 —— 除非你手动配了端口转发。&lt;/p&gt;</description></item></channel></rss>