portr

amalshajiAGPL-3.0活跃维护

自托管的反向隧道工具,把本地 HTTP、TCP 或 WebSocket 服务暴露到公网,可替代 ngrok 做内网穿透和本地调试。

Expose local http, tcp or websocket connections to the public internet

v2.1.0发布于 2026-11-01 10:17 UTC3,197star115fork同步于 2026-11-10 23:42 UTC

怎么上手

由 README 提炼,执行前请确认
portr http 9000
硬件要求按 README 说明

README 未说明

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

项目说明

由 README 自动翻译提炼

自托管隧道工具,把本地 HTTP、TCP、WebSocket 服务暴露到公网,适合小团队共享开发环境

自托管的反向隧道工具,把本地 HTTP、TCP 或 WebSocket 服务暴露到公网,可替代 ngrok 做内网穿透和本地调试。

核心能力

  • 支持 HTTP、TCP、WebSocket 三种隧道类型
  • 服务端可选 SSH 或 WebSocket 作为隧道传输
  • 内置本地 Inspector,可查看、重放请求并调试 WebSocket
  • 通过 portr.enable 标签自动暴露 Docker Compose 服务
  • portr logs 从本地 SQLite 查询请求日志

容易踩的坑

需先自建或使用已有的 Portr 服务端,客户端不能单独工作;Inspector 默认占用本地 7777 端口;HTTP 隧道默认开两个 worker,需在客户端配置里改 pool_size

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

最近发版

5 个版本v2.1.0
  1. v2.1.0最新正式版2026-11-01 · 2026-11-01 10:17 UTC

    What's Changed

    Full Changelog: https://github.com/amalshaji/portr/compare/v1.0.19...v2.1.0

  2. v2.0.02026-09-27 · 2026-09-27 08:48 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/amalshaji/portr/compare/v1.0.18...v2.0.0

  3. v1.0.182026-08-12 · 2026-08-12 16:10 UTC
    查看更新说明

    Changelog

    • 30ec3333b01f463163b3045f60372d4deb36f3e5 Indicate basic auth in the TUI and adapt status colors for light terminals (#313)
    • b768c9009754c792a3dfb0527981db5744d75c59 Accept CLI flags anywhere on the command line (#312)
    • 63f969042fba019ecb9227c31254f4dea2a331b9 feat(client): add basic auth for http tunnels (#310)
    • 3d78e17c40fe3aaf6c6716164e1580525cb2b8e2 Add Litestream backup for SQLite deployments (#309)
    • 5256cbd3d9f42369e399abc5cdff7c85b57015a7 Require a domain mapping to enable auto signup (#306)
  4. v1.0.172026-08-09 · 2026-08-09 09:34 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/amalshaji/portr/compare/v1.0.16...v1.0.17

  5. v1.0.162026-08-03 · 2026-08-03 18:53 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/amalshaji/portr/compare/v1.0.15...v1.0.16

用户点评

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

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

    README 原文

    未翻译

    Portr is a tunnel solution that allows you to expose local HTTP, TCP, or WebSocket services to the public internet. Servers can run either SSH or WebSocket as the client-to-server tunnel transport, and generated client configs tell the client which transport to use.

    Portr is primarily designed for small teams looking to expose development servers on a public URL. It is not recommended for use alongside production servers.

    Features

    • 🎉 Expose local HTTP, TCP, and WebSocket services on public URLs.
    • 🚨 Built-in local inspector on http://localhost:7777 for request inspection, replay, and WebSocket session debugging. Watch video.
    • 🐳 Tunnel Docker Compose services by adding a portr.enable label. Docker Compose guide.
    • 🤖 Agent-friendly local request logs with portr logs, backed by ~/.portr/db.sqlite.
    • 👾 Admin dashboard for team, user, and connection management. Watch video.

    Quick Start

    1. Set up a Portr server or use an existing one.
    2. Install the Portr client on your machine.
    3. Start a local service, then expose it:
    portr http 9000
    

    To pin the tunnel to a subdomain:

    portr http 9000 -s amal-test
    # or
    portr http 9000 --subdomain amal-test
    

    Starting an HTTP tunnel does three useful things immediately:

    • Creates a public HTTPS URL that forwards to your local service.
    • Starts the Portr inspector locally at http://localhost:7777.
    • Persists HTTP request logs locally so they can be queried from the CLI.

    HTTP tunnels also support WebSocket upgrades, so a local WebSocket endpoint behind the tunneled HTTP service can be reached with wss://<subdomain>.<server-domain>. HTTP tunnels start two tunnel workers by default; set pool_size in the client config when you need a different worker count.

    Inspector And Logs

    The local inspector lets you:

    • inspect incoming HTTP requests and responses
    • replay stored requests as-is or edit method, path, headers, and body before replaying
    • inspect headers and payloads
    • monitor upgraded WebSocket sessions and captured frames

    The same stored request data is available from the CLI:

    # Show the latest logs for a subdomain
    portr logs amal-test
    
    # Filter by URL substring
    portr logs amal-test /api/
    
    # Emit the full stored records as JSON
    portr logs amal-test --json
    

    Setup

    Deploy the server on Railway with one click (see the Railway guide):

    Deploy on Railway

    Agent Skills

    This repo includes a portr-cli skill for Claude Code and Codex through Vercel Labs skills.

    Install it into both agents from GitHub:

    npx skills add amalshaji/portr --skill portr-cli -a claude-code -a codex -y
    

    To install it globally instead:

    npx skills add amalshaji/portr --skill portr-cli -a claude-code -a codex -g -y
    

    Contributing

    Please read through our contributing guide and set up your development environment.

    License

    This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See the LICENSE file for the full license text.