需先自建或使用已有的 Portr 服务端,客户端不能单独工作;Inspector 默认占用本地 7777 端口;HTTP 隧道默认开两个 worker,需在客户端配置里改 pool_size
portr
amalshajiAGPL-3.0活跃维护自托管的反向隧道工具,把本地 HTTP、TCP 或 WebSocket 服务暴露到公网,可替代 ngrok 做内网穿透和本地调试。
Expose local http, tcp or websocket connections to the public internet
自托管隧道工具,把本地 HTTP、TCP、WebSocket 服务暴露到公网,适合小团队共享开发环境
自托管的反向隧道工具,把本地 HTTP、TCP 或 WebSocket 服务暴露到公网,可替代 ngrok 做内网穿透和本地调试。
核心能力
- 支持 HTTP、TCP、WebSocket 三种隧道类型
- 服务端可选 SSH 或 WebSocket 作为隧道传输
- 内置本地 Inspector,可查看、重放请求并调试 WebSocket
- 通过 portr.enable 标签自动暴露 Docker Compose 服务
- portr logs 从本地 SQLite 查询请求日志
容易踩的坑
- v2.1.0最新正式版2026-11-01 · 2026-11-01 10:17 UTC
What's Changed
- fix: patch Next.js security alerts in docs by @amalshaji in https://github.com/amalshaji/portr/pull/322
- docs: add Fly.io server deployment guide by @amalshaji in https://github.com/amalshaji/portr/pull/324
- docs: use a single static OG image on all pages by @amalshaji in https://github.com/amalshaji/portr/pull/325
- Migrate Railway config to Infrastructure as Code by @amalshaji in https://github.com/amalshaji/portr/pull/327
- docs: note Railway edge compression weakens ETags by @amalshaji in https://github.com/amalshaji/portr/pull/328
- Add Connect page to admin console by @amalshaji in https://github.com/amalshaji/portr/pull/329
- Add portr docker command for docker compose label tunnels by @amalshaji in https://github.com/amalshaji/portr/pull/330
- Multiplex websocket tunnels with yamux by @amalshaji in https://github.com/amalshaji/portr/pull/331
- Raise the yamux stream window to 512 KiB by @amalshaji in https://github.com/amalshaji/portr/pull/332
- Reuse connections through the websocket tunnel by @amalshaji in https://github.com/amalshaji/portr/pull/333
- chore(deps): bump github.com/klauspost/compress from 1.18.0 to 1.18.7 by @dependabot[bot] in https://github.com/amalshaji/portr/pull/326
- Bump next and satori in docs for Dependabot alerts by @amalshaji in https://github.com/amalshaji/portr/pull/334
Full Changelog: https://github.com/amalshaji/portr/compare/v1.0.19...v2.1.0
- v2.0.02026-09-27 · 2026-09-27 08:48 UTC
查看更新说明
What's Changed
- Add configurable SSH or WebSocket tunnel transport by @amalshaji in https://github.com/amalshaji/portr/pull/247
Full Changelog: https://github.com/amalshaji/portr/compare/v1.0.18...v2.0.0
- 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)
- v1.0.172026-08-09 · 2026-08-09 09:34 UTC
查看更新说明
What's Changed
- Add GitHub auto signup by @amalshaji in https://github.com/amalshaji/portr/pull/253
- Add admin user management CLI by @amalshaji in https://github.com/amalshaji/portr/pull/295
- Add tunnel groups to client config by @amalshaji in https://github.com/amalshaji/portr/pull/296
- Add portr serve for static directories by @amalshaji in https://github.com/amalshaji/portr/pull/300
- Add portr doctor by @amalshaji in https://github.com/amalshaji/portr/pull/298
- Add host_header option for http tunnels by @amalshaji in https://github.com/amalshaji/portr/pull/297
- Add QR code toggle to the terminal interface by @amalshaji in https://github.com/amalshaji/portr/pull/299
- Add team client templates by @amalshaji in https://github.com/amalshaji/portr/pull/301
Full Changelog: https://github.com/amalshaji/portr/compare/v1.0.16...v1.0.17
- v1.0.162026-08-03 · 2026-08-03 18:53 UTC
查看更新说明
What's Changed
- New Portr landing, docs and logo by @amalshaji in https://github.com/amalshaji/portr/pull/282
- Fix Docker admin asset build by @amalshaji in https://github.com/amalshaji/portr/pull/288
Full Changelog: https://github.com/amalshaji/portr/compare/v1.0.15...v1.0.16
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
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:7777for request inspection, replay, and WebSocket session debugging. Watch video. - 🐳 Tunnel Docker Compose services by adding a
portr.enablelabel. 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
- Set up a Portr server or use an existing one.
- Install the Portr client on your machine.
- 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):
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.