portal-tunnel

gosudaMIT活跃维护

自托管的内网穿透工具,通过去信任中继把本地服务发布到 agentic web,支持端到端加密和 NAT 穿透,可作为 ngrok 替代。

Publishes localhost services to the agentic web through self-hostable, trustless relays.

v2.7.4发布于 2026-11-09 10:53 UTC302star +1 / 7 天31fork同步于 2026-11-11 05:57 UTC

怎么上手

由 README 提炼,执行前请确认
curl -fsSL https://github.com/gosuda/portal-tunnel/releases/latest/download/install.sh | bash
portal expose 3000
硬件要求按 README 说明

README 未说明

有 Docker 镜像
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

自托管中继隧道,把本地服务发布到公网,无需端口转发和账号

自托管的内网穿透工具,通过去信任中继把本地服务发布到 agentic web,支持端到端加密和 NAT 穿透,可作为 ngrok 替代。

核心能力

  • 用一条命令启动自托管中继,支持公开与社区中继多路故障切换
  • 未缓存 HTTPS 流量的 TLS 在本地隧道进程终结,中继只转发密文
  • 原生自检比对 TLS 密钥材料,--ban-mitm 可封禁可疑中继
  • 用本地 secp256k1 身份文件认证,无需账号和 API Key
  • 支持 HTTP 路由挂载、裸 TCP 端口暴露和 IVNP 覆盖网络回程

容易踩的坑

自托管中继需先复制 .env.example 为 .env 再执行 docker compose up;--name 短域名被占用时只会输出带以太坊地址的身份绑定 URL;中继仍属信任边界,持证书私钥的恶意中继可冒充端点且自检只抽样连接

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v2.7.4
  1. v2.7.4最新正式版2026-11-09 · 2026-11-09 10:53 UTC

    What's Changed

    Full Changelog: https://github.com/gosuda/portal-tunnel/compare/v2.7.3...v2.7.4

  2. v2.7.32026-11-07 · 2026-11-07 20:05 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/gosuda/portal-tunnel/compare/v2.7.2...v2.7.3

  3. v2.7.22026-11-07 · 2026-11-07 08:12 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/gosuda/portal-tunnel/compare/v2.7.1...v2.7.2

  4. v2.7.12026-10-30 · 2026-10-30 17:09 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/gosuda/portal-tunnel/compare/v2.7.0...v2.7.1

  5. v2.7.02026-10-27 · 2026-10-27 15:56 UTC
    查看更新说明

    What's Changed

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Portal - Self-Hostable Relay Tunnel for Localhost

    CI GitHub Release License awesome-tunneling

    English | 简体中文

    Why Portal?

    Portal is an open-source tunnel runtime and relay network for publishing services to the agentic web. It exposes local apps, APIs, tools, and agents through self-hosted or public relays, keeps routing and security policy in the local tunnel process, and eliminates the need for hosted vendor accounts or credit cards.

    • Self-Hostable & Open Source - Run your own relay with a single command. MIT-licensed with zero telemetry, no enterprise tiers, and no call-home.
    • Anonymous Relay Network - Connect to public relays or combine self-hosted and community relays into resilient multi-relay failover pools.
    • End-to-End Tenant TLS - For uncached HTTPS stream exposures, TLS terminates in your local tunnel process. Forwarding relays handle ciphertext; relay-held certificate keys remain part of the trust boundary.
    • IVNP-backed Overlay Networking - Bridge reverse backhauls over an independent IVNP overlay network when enhanced routing privacy is desired.
    • Built-in MITM Detection - The native self-probe compares TLS keying material on a sampled connection; --ban-mitm blocks a relay for that exposure when exporter values differ.
    • No Accounts, No API Keys - Authentication uses local secp256k1 cryptographic identities (identity.json) with SIWE challenge signing.
    • Native x402 Payments - Route-level micropayments using gasless Sui USDC, Casper wCSPR, or Nano XNO without traditional payment processors.

    📖 Explore the Complete Product Capabilities: For the complete matrix of all 20+ supported capabilities across CLI, Agent, SDK, and Relay—including interface support and trust boundaries—see the Canonical Feature Inventory.

    Comparison

    PortalngrokCloudflare Tunnelfrp
    Public localhost URLYesYesYesYes
    Self-hostableYesEnterprise onlyNoYes
    Open sourceMITNoClient onlyApache 2.0
    Custom domainYesPaid plansYesYes
    End-to-end tenant TLSYes (uncached exposures)NoNoNo
    MITM self-probeYes (TLS keying material export)NoNoNo
    Multi-relay failoverYesManagedBuilt-inNo
    Account requiredNoYesYesNo
    Native x402 paymentsYesNoNoNo

    Quick Start

    1. Expose a local service

    macOS / Linux:

    curl -fsSL https://github.com/gosuda/portal-tunnel/releases/latest/download/install.sh | bash
    portal expose 3000
    

    Windows (PowerShell):

    $ProgressPreference = 'SilentlyContinue'
    irm https://github.com/gosuda/portal-tunnel/releases/latest/download/install.ps1 | iex
    portal expose 3000
    

    Portal prints an HTTPS URL when the tunnel is ready. To get a short URL without an Ethereum address, use --name myapp when creating the identity. When that name is available, share https://myapp.<relay-domain>/, printed as short URL in the readiness message (alias_url in JSON logs). The identity-bound URL is also available; it includes the Ethereum address and supports opt-in relay caching. If the name is already taken, Portal prints only the identity-bound URL. An existing identity keeps its saved name; use a new --identity-path to choose a different name. Additional common usages:

    # Custom name and explicit relay
    portal expose 3000 --name myapp --relays https://portal.example.com --discovery=false
    
    # Mount multiple local services behind one domain
    portal expose --name myapp \
      --http-route /api=http://127.0.0.1:3001 \
      --http-route /=http://127.0.0.1:5173
    
    # Dedicated raw TCP port (Minecraft, SSH, databases)
    portal expose localhost:25565 --name minecraft --tcp
    
    # Prefer an IVNP overlay backhaul path
    portal expose 3000 --overlay
    

    2. Use the local AI agent plugin

    The repository includes two plugins for Codex, Claude Code, and Cursor: portal-tunnel (portal-expose and portal-connect) for publishing and reaching services, and portal-relay for running a relay:

    # GitHub CLI
    gh skill install gosuda/portal-tunnel portal-tunnel/portal-expose
    
    # skills CLI
    npx skills add gosuda/portal-tunnel --skill portal-expose
    

    Ask your agent: "Expose my app on port 3000 with Portal and verify the public URL." See plugins/portal-tunnel/README.md and plugins/portal-relay/README.md for full setup instructions.

    3. Manage persistent tunnels with Portal Agent

    When tunnels should run continuously in the background or as a system service:

    portal agent run --config config.toml
    portal agent dashboard --config config.toml
    

    See the Portal Agent Guide for configuration syntax and OS service installation.

    4. Run your own relay

    Deploy an open-source relay in seconds:

    git clone https://github.com/gosuda/portal-tunnel
    cd portal-tunnel && cp .env.example .env
    docker compose up
    

    See Deployment for DNS automation (ACME), TCP/UDP port ranges, and production policy configuration.

    How End-to-End Encryption Works

    The ordinary uncached forwarding path works as follows:

    Browser
      -> Relay SNI router  (reads ClientHello/SNI, forwards tenant ciphertext)
      -> Reverse session
      -> Portal tunnel     (completes TLS handshake locally, derives session keys)
      -> Local service
    
    1. SNI Routing: The relay accepts the incoming connection and reads only the TLS ClientHello for SNI-based lease routing.
    2. Raw Forwarding: It forwards the raw encrypted stream over the reverse session without terminating TLS.
    3. Local Handshake: The Portal tunnel completes the TLS handshake locally; session keys are derived on your machine.
    4. Keyless Signing: For relay-hosted domains, the relay signs handshake transcripts via /v1/sign. The relay never receives session keys.
    5. Ciphertext Security: The relay continues forwarding ciphertext without access to tenant plaintext.

    Portal minimizes relay trust; it does not yet eliminate it. A malicious relay with the certificate private key can still impersonate an endpoint, and the self-probe checks only sampled connections. See the Security Model for guarantees and exceptions, or Keyless TLS Explained for the design rationale.

    Public Relay Registry

    Portal includes the official public relay registry by default:

    https://raw.githubusercontent.com/gosuda/portal-tunnel/main/registry.json
    

    If you operate a public Portal relay, open a pull request to add your relay URL to registry.json.

    Documentation

    Contributing

    See CONTRIBUTING.md.

    License

    MIT License - see LICENSE.