使用一个 curl 命令使 localhost 公开 — Portal Tunnel
Portal and Tunnel
We can create programs anywhere With AI.
我们可以借助 AI 在任何地方创建程序。
But no matter how great a program is, it usually lives only on your own computer — on localhost.
但是,无论程序多么出色,它通常只存在于您自己的计算机上——即在 localhost 上。
To expose it to the outside world, you normally have to go through complicated steps such as router configuration, firewall rules, public IP setup, and tunnel configuration. 为了将其暴露给外部世界,您通常必须经历复杂的步骤,例如路由器配置、防火墙规则、公共 IP 设置和隧道配置。
What if all of this could be solved with a single line of command? 如果所有这些都可以通过一行命令来解决呢?
With Portal’s tunnel, you can turn your local program into a public service with just one command. 借助 Portal 的隧道,您只需一个命令即可将您的本地程序转变为公共服务。
Make localhost public
First, run your program locally.
首先,在本地运行您的程序。
Then, this single line is all you need:
然后,您所需要的只是这一行命令:
1curl -fsSL portal.gosuda.org/tunnel | PORT=3000 NAME={app name} sh
- Check that your app is now publicly accessible:
- 检查您的应用程序现在是否可以公开访问:
- {app name}.portal.gosuda.org
Multi-tenancy
Portal is designed as an open network, not a single service. Anyone can operate a portal relay, and a single app can be connected to multiple portals simultaneously for redundancy or geographic distribution. Portal 被设计为一个开放网络,而非单一服务。任何人都可以运营一个 Portal 中继,并且单个应用程序可以同时连接到多个 Portal,以实现冗余或地理分布。
1# Publish to multiple portal relays at once
2# 一次性发布到多个 Portal 中继
3curl -fsSL http://portal.gosuda.org/tunnel | \
4PORT=3000 \
5NAME={app_name} \
6RELAY_URL=portal.thumbgo.kr,portal.iwanhae.kr,s-h.day,portal.lmmt.eu.org \
7sh
A list of active public portals is maintained in the Portal List app (which is itself hosted on the Portal network): 一个活跃的公共 Portal 列表在 Portal List 应用程序中维护(该应用程序本身托管在 Portal 网络上):https://portal-list.portal.gosuda.org/
This represents a truly permissionless publishing environment that is not dependent on any specific provider or infrastructure. 这代表了一个真正的无需许可的发布环境,不依赖于任何特定的提供商或基础设施。
Comparison with Other Services
Tools like ngrok and cloudflared are widely used to expose local services to the public internet. 像 ngrok 和 cloudflared 这样的工具被广泛用于将本地服务暴露给公共互联网。 However, Portal is fundamentally different in both design philosophy and usage model. 然而,Portal 在设计理念和使用模型上都存在根本性的不同。
ngrok and cloudflared are centralized, SaaS-based tunneling services. ngrok 和 cloudflared 是集中式的、基于 SaaS 的隧道服务。 They require account creation, token issuance, binary installation, and configuration before use, and users are inevitably subject to service policies and pricing models. 它们在使用前需要创建账户、颁发令牌、安装二进制文件和配置,并且用户不可避免地要受到服务政策和定价模型的约束。
In contrast, Portal Tunnel: 相比之下,Portal Tunnel:
- Runs in one line without installation
- 只需一行即可运行,无需安装
- Publishes instantly without accounts or tokens
- 无需账户或令牌即可即时发布
- Allows anyone to operate a relay
- 允许任何人运营中继
- Lets a single app connect to multiple portals simultaneously
- 允许单个应用程序同时连接到多个 Portal
- Is a pure network architecture without dependency on any specific vendor
- 是一种纯粹的网络架构,不依赖于任何特定的供应商
These characteristics place Portal Tunnel in a completely different category from traditional tunneling services.