private-connect
v0.7.5
Published
Access private services by name from anywhere. No VPN setup, no firewall rules. Open source alternative to ngrok and Tailscale for service-level connectivity.
Maintainers
Readme
Private Connect
Zero-friction connectivity tools. No signup required.
Installation
npm i private-connect # add to your project
npm i -g private-connect # install globallyRun it: after a global install use private-connect; after a local install use npx private-connect. Or run without installing: npx private-connect <command>.
Quick Start
# Share your entire local environment with a teammate
npx private-connect up 3000 5432 6379
# → Prints: npx private-connect join abc123
# Teammate joins with one command
npx private-connect join abc123
# → All three ports available on their localhost. Done.
# Create a temporary public tunnel
npx private-connect tunnel 3000
# Test connectivity to any service
npx private-connect test db.internal:5432Commands
up - Share your environment
npx private-connect up <port1> [port2] [port3] ...Share multiple local services at once. Your teammate gets a single join code.
Examples:
npx private-connect up 3000 # Share one service
npx private-connect up 3000 5432 6379 # Share app + Postgres + RedisOutput:
Private Connect - Share Environment
────────────────────────────────────
Sharing 3 services:
localhost:3000 → api.privateconnect.co:40001 (port 3000)
localhost:5432 → api.privateconnect.co:40002 (PostgreSQL)
localhost:6379 → api.privateconnect.co:40003 (Redis)
────────────────────────────────────
Share this with your teammate:
npx private-connect join k7m2p9
Expires in 120 minutesjoin - Connect to a shared environment
npx private-connect join <code>Connect to a teammate's shared environment. All ports are forwarded to your localhost.
Example:
npx private-connect join k7m2p9Output:
Private Connect - Join Environment
────────────────────────────────────
Connecting to 3 services:
localhost:3000 → port 3000
localhost:5432 → PostgreSQL
localhost:6379 → Redis
────────────────────────────────────
Connected! Use these in your app:
port 3000: localhost:3000
PostgreSQL: localhost:5432
Redis: localhost:6379
Expires in 118 minutesIf a port is busy on the joiner's machine, it automatically picks a nearby available port.
test - Test connectivity
npx private-connect test <target>Examples:
npx private-connect test db.internal:5432 # Database
npx private-connect test redis:6379 # Redis
npx private-connect test https://api.internal # APIWhat it checks:
- TCP connection
- TLS/SSL (if applicable)
- HTTP response (for web services)
- Latency
tunnel - Create a temporary tunnel
npx private-connect tunnel <port>Instantly expose a local service to the internet. No signup required.
Examples:
npx private-connect tunnel 3000 # Expose localhost:3000
npx private-connect tunnel localhost:8080 # Specify host and port
npx private-connect tunnel 3000 --slug myapp --ttl 1440 # Stable URL, 24h (no signup)Stable URL and TTL: Use --slug <name> for a stable subdomain (e.g. https://myapp.privateconnect.co) when available, and --ttl <minutes> for longer sessions (default 120; server allows up to 24h).
Named subdomains: When you use a provider or app name, it becomes the subdomain prefix:
npx private-connect stripe 3000 # → https://stripe-a1b2.privateconnect.co
npx private-connect myapp 3000 # → https://myapp-f3d9.privateconnect.co
npx private-connect tunnel 3000 # → https://abc12345.privateconnect.co (random)Output:
Private Connect - Temporary Tunnel
────────────────────────────────────
Local: localhost:3000
Public: https://stripe-a1b2.privateconnect.co
Anyone can access this URL
Inspector: https://privateconnect.co/debug/s-xyz789
Live traffic monitoring & request replay
Expires: 120 minutes
────────────────────────────────────
Press Ctrl+C to stopTCP/UDP Tunnels:
npx private-connect tunnel 5432 --tcp # TCP tunnel (databases, etc.)
npx private-connect tunnel 27015 --udp # UDP tunnel (game servers, etc.)TCP/UDP output shows connection details:
Local: localhost:5432
Public: tcp://api.privateconnect.co:40001
Connect: api.privateconnect.co:40001
Expires: 120 minutesSharing:
- The public URL shows your actual website (like ngrok)
- Perfect for demos, testing, and sharing with teammates
- Works immediately - no landing page, just your app
Features:
- No signup or account required
- Sessions up to 24h with
--ttl; stable URL with--slug - Real-time request logging
- Works with HTTP, TCP, and UDP services
- Shareable URLs - The public URL shows your actual website, perfect for demos and testing
<provider> <port> - Webhook tunnel with provider setup
npx private-connect <provider> <port>Create a tunnel and get provider-specific webhook setup instructions.
Known providers (with tailored instructions):
Any provider name works — unknown names get generic webhook guidance.
Examples:
npx private-connect polar 3000 # Polar webhooks → localhost:3000
npx private-connect stripe 3000 # Stripe webhooks → localhost:3000
npx private-connect github 8080 # GitHub webhooks → localhost:8080
npx private-connect myapp 3000 # Generic webhooks → localhost:3000setup-openclaw - One-command OpenClaw setup
npx private-connect setup-openclawQuickly set up remote access to your OpenClaw (formerly Moltbot) gateway:
- Detects OpenClaw on localhost:18789
- Creates temporary tunnel for remote access
- Shows next steps for permanent setup
pair - Mobile pairing
npx private-connect pairGenerate a QR code to pair your mobile device for remote access.
list - List active tunnels
npx private-connect listclose - Close tunnels
npx private-connect close <tunnelId>
npx private-connect close --allHow Temporary Tunnels Work
┌──────────────┐ WebSocket ┌─────────────────────┐ HTTPS ┌─────────┐
│ Your Machine│◄───────────────────────►│ privateconnect.co │◄────────────────────│ Internet│
│ │ (persistent connection) │ (Hub) │ (TLS termination) │ │
│ localhost:N │ │ │ │ │
└──────────────┘ └─────────────────────┘ └─────────┘- You run
npx private-connect tunnel 3000. - The CLI opens a WebSocket to the hub (
api.privateconnect.co). - The hub assigns a public subdomain (e.g.
abc12345.privateconnect.co) and handles TLS. - When a request arrives at the public URL, the hub forwards it over the WebSocket to your CLI.
- Your CLI forwards it to
localhost:3000and sends the response back.
Key properties:
- No open ports — Your machine only makes outbound connections (WebSocket).
- Auto-reconnect — If the connection drops, the CLI reconnects automatically (up to 10 retries with backoff).
- No signup — Tunnels are ephemeral (2-hour TTL). No account required.
- End-to-end — Request bodies are forwarded in-memory over the WebSocket; nothing is stored on disk.
- TCP/UDP — For
--tcpand--udptunnels, the hub allocates a public port and relays raw packets the same way.
Installation Options
Quick (npx)
npx private-connect tunnel 3000Full Install (with daemon)
curl -fsSL https://privateconnect.co/install.sh | bash
connect upAutomated/Non-interactive
# For scripts, CI/CD, or VM provisioning
curl -fsSL https://privateconnect.co/install.sh | bash -s -- \
--non-interactive \
--api-key=YOUR_KEY \
--daemonOptions:
--non-interactive- Skip all prompts--api-key=KEY- Set API key for authentication--daemon- Install and start background service--expose-openclaw- Expose OpenClaw gateway after install
Need more?
For permanent tunnels, sharing with teammates, and AI agent integration:
