connect proxy command starts a local HTTP/HTTPS proxy that routes requests to services based on subdomain, enabling access via URLs like http://postgres.localhost:3456.
Usage
Actions
Start the proxy server (default action)
stop
Stop the running proxy server
status
Show proxy status and active routes
trust
Trust the local CA certificate for HTTPS
Options
Port to listen on
Enable HTTPS with auto-generated certificates
Path to custom TLS certificate
Path to custom TLS private key
Automatically trust the CA certificate
Kill existing process on the port and take over
Run in foreground (for debugging)
Hub server URL
Path to custom config file
Examples
Start HTTP Proxy
Start HTTPS Proxy
Custom Port
Custom TLS Certificates
Stop Proxy
Check Status
Trust CA Certificate
Behavior
Subdomain Routing
The proxy routes requests based on the subdomain in theHost header:
- Extract subdomain from
Hostheader - Look up service in route table
- Proxy request to service’s local port
- Return response to client
Route Discovery
The proxy discovers services from two sources: Hub Services:- Services exposed by other agents
- Fetched from hub API every 10 seconds
- Requires active tunnel port
- Services reached via
connect reach - Read from
~/.privateconnect/active-routes.json - Updated in real-time via file watching
Daemon Mode
By default, the proxy runs as a background daemon:~/.privateconnect/proxy.log.
Foreground Mode
For debugging:Auto-Start
The proxy is automatically started byconnect reach if not already running:
HTTPS Certificates
When using--https, the proxy:
- Generates CA (if not exists):
~/.privateconnect/certs/ca.crt - Generates server cert:
~/.privateconnect/certs/server.crt - Trusts CA: Adds to system keychain (macOS) or certificate store (Linux)
WebSocket Support
The proxy supports WebSocket upgrades:HTTP CONNECT
For HTTPS proxying through HTTP proxy:Error Handling
Service Not Found
Service Unreachable
Port Already in Use
--replace to take over:
State Management
Proxy state is tracked in~/.privateconnect/proxy-state.json:
- Detection if proxy is already running
- Port discovery for auto-start
- Process management
Exit Codes
0- Proxy started/stopped successfully1- Port conflict, network error, or certificate error
Platform Support
macOS
- Full support for HTTPS certificate trust
- Uses system keychain
- DNS resolution for
.localhostworks natively
Linux
- HTTPS certificate trust via
update-ca-certificates - May require
sudofor trust operation .localhostDNS resolution may need/etc/hostsor dnsmasq
Windows
- HTTPS certificate trust via certificate store
- May require admin privileges
.localhostDNS resolution viahostsfile
Use Cases
Browser-Based Access
Access databases through web UIs:Webhook Testing
Test webhooks locally with readable URLs:Service Discovery
Explore available services:Multi-Service Development
Access entire stack via URLs:Related Commands
connect reach- Create routes for proxyconnect expose- Expose services accessible via proxyconnect dev- Multi-service setup with proxy integration
Troubleshooting
Certificate Warnings
If you see browser warnings:~/.privateconnect/certs/ca.crt
DNS Not Resolving
Ifpostgres.localhost doesn’t resolve:
macOS:
- Should work natively
- Check:
ping postgres.localhost
Proxy Not Auto-Starting
Ifconnect reach doesn’t auto-start proxy: