RepositoryTypeScript
vercel-labs

vercel-labs/portless

Replace port numbers with stable, named local URLs. For humans and agents.

13.0ksao
456fork
40issue
7lượt xem

🔗 Stable .localhost URLs replacing port numbers

Replace http://localhost:3000 with https://myapp.localhost for local dev. For humans and agents.

portless by Vercel Labs is a local development proxy that replaces random port numbers with stable, named .localhost URLs. It auto-generates a local CA, trusts it, and enables HTTPS with HTTP/2 by default. The proxy auto-starts apps, assigns random ports (4000-4999), and reuses config across restarts.

✨ Highlights

  • Named URLs: Replace port numbers with stable .localhost domains like https://myapp.localhost
  • HTTPS by default: Auto-generates a local CA, trusts it, and binds port 443 with HTTP/2 support
  • Framework auto-detection: Respects PORT env var or auto-injects --port/--host flags for Vite, Astro, etc.
  • Config persistence: Reuses port, TLS, and TLD settings from the last proxy run on restart
  • Monorepo support: Discovers packages via pnpm-workspace.yaml or workspaces field in package.json
  • CI-friendly: Exits with descriptive errors in non-interactive environments instead of prompting
  • Subdomain routing: Organize services with subdomains like https://api.myapp.localhost
  • Turborepo integration: No changes to turbo.json needed; works through pnpm dev

💡 Why it matters

Unlike manually managing port numbers, portless provides stable URLs that persist across restarts and reboots. This makes local development URLs predictable for both humans and automated tools/agents. The auto-trusting CA setup removes the usual browser warnings for local HTTPS.

Best suited for local development workflows in monorepos or multi-service projects where stable, memorable URLs improve productivity.


#LocalDevelopment #TypeScript #VercelLabs #DevTools #TiniX