lpm proxy
Run and inspect the local proxy for friendly HTTPS development hostnames.
lpm proxy manages the local daemon that routes friendly hostnames, such as app.localhost, to services that lpm dev starts.
For HTTPS routes, the proxy terminates TLS. The child dev server continues to use HTTP.
lpm proxy [action]Use this command to inspect routes, run a temporary daemon, or install a persistent service for the current user.
Examples
lpm proxy status # show the daemon, listeners, and active routes
lpm proxy list # show only active routes
lpm proxy start # run the daemon in the foreground
lpm proxy start --detach
lpm proxy start --http-port 8080
lpm proxy start --tls-port 9443
lpm proxy start --tls-port 9443 --http-redirect-port 9080
lpm proxy stop
lpm proxy install --tls-port 9443
lpm proxy install --privileged-ports
lpm proxy uninstall
lpm proxy uninstall --privileged-ports
lpm proxy status --jsonChoose an action
| Goal | Command |
|---|---|
| Show the daemon, listeners, and active routes | lpm proxy status |
| Show only active routes | lpm proxy list |
| Start a foreground daemon | lpm proxy start |
| Start a background daemon | lpm proxy start --detach |
| Stop the current daemon | lpm proxy stop |
| Install a persistent user service | lpm proxy install |
| Remove the persistent user service | lpm proxy uninstall |
status is the default action. A bare lpm proxy command equals lpm proxy status.
How proxy routing works
The proxy separates the browser connection from the dev-server connection:
lpm devstarts the child service with a plain HTTP endpoint.- If no daemon runs,
lpm devstarts the proxy daemon in the background. lpm devregisters each configured hostname against the final service port.- The proxy selects a route from the request hostname and forwards the request to the service.
- When the dev session exits,
lpm devreleases its route lease.
HTTP forwarding streams response bodies and supports WebSocket and HMR upgrades.
lpm dev requires an HTTPS proxy listener for configured hostnames. A control-only daemon or a plain HTTP listener is not sufficient.
Do not enable framework HTTPS for a proxied child service. Let the proxy terminate TLS and forward to the plain HTTP service.
Recipes
Use app.localhost without privileged ports
Add a high HTTPS port to lpm.json:
{
"proxy": {
"host": "app.localhost",
"port": 9443,
"httpRedirect": false
}
}Then start the dev server:
lpm devIf no daemon runs, lpm dev starts one in the background. It registers app.localhost for the lifetime of the dev session.
The startup output shows the exact URL with port 9443. A *.localhost hostname does not require a hosts-file entry.
Route multiple services
Give each service a different hostname:
{
"proxy": {
"port": 9443,
"httpRedirect": false
},
"services": {
"web": {
"command": "vite",
"port": 5173,
"host": "web.localhost"
},
"api": {
"command": "node api.js",
"port": 4000,
"host": "api.localhost"
}
}
}lpm dev
lpm proxy listThe route table shows each hostname, service, project directory, and final upstream port.
Start the proxy manually
Use a foreground daemon while you diagnose listener or certificate errors:
lpm proxy start --tls-port 9443 --http-redirect-port 9080When another terminal does not need the proxy log, use a detached daemon:
lpm proxy start --detach --tls-port 9443The detached command waits for the daemon to report that it is ready.
Change the listeners
An existing daemon does not accept listener changes from another detached start. Stop the daemon before you select new listeners.
lpm proxy status
lpm proxy stop
lpm proxy start --detach --tls-port 9443If an installed service owns the daemon, use lpm proxy uninstall to remove that persistent service.
Listener selection
Listener flags are exact overrides. If one listener flag is present, LPM CLI does not read listener values from lpm.json.
| Command state | Listeners |
|---|---|
| No flags and a configured local hostname | HTTPS uses proxy.port, or 443 by default. HTTP redirect uses port 80 unless proxy.httpRedirect is false. |
| No flags and no configured local hostname | The daemon starts with only its control endpoint. |
| One or more listener flags | Only the specified listeners start. Unspecified listeners remain disabled. |
When you want configuration-based listeners, run start or install from the directory that contains lpm.json.
The listener flags bind only to 127.0.0.1. Port 0 lets the operating system select an available port.
--http-redirect-port requires --tls-port in the same command:
lpm proxy start --tls-port 9443 --http-redirect-port 9080Install a persistent service
Install a user-scoped service on a high port:
lpm proxy install --tls-port 9443The installation also starts the service. The service uses the current directory as its project directory.
| Platform | Persistent service |
|---|---|
| macOS | LaunchAgent |
| Linux | systemd user service |
| Windows | Logon Scheduled Task |
On Linux and macOS, a user service cannot bind ports from 1 through 1023. Use high ports or install the privileged forwarder.
Use ports 443 and 80 on Linux or macOS
Run the command as the target user:
lpm proxy install --privileged-portsDo not run the full command with sudo. LPM CLI uses sudo only for the root-owned forwarder files and service.
The command installs two services:
- A proxy daemon for the current user.
- A root-owned loopback forwarder for low ports.
Without explicit listener flags, the forwarder exposes HTTPS on port 443. It also exposes the redirect on 80 unless proxy.httpRedirect is false.
The user daemon selects an available HTTPS backend port from 9443. It selects a redirect backend port from 9080.
The privileged forwarder supports HTTPS and HTTP redirects. It does not support plain --http-port forwarding.
CAUTION: Do not use
--replaceunless you intend to replace the privileged forwarder of another user.
Remove only the user service:
lpm proxy uninstallRemove the user service and the privileged forwarder:
lpm proxy uninstall --privileged-portsThe uninstall command refuses to remove a privileged forwarder that belongs to another user.
Certificates and hosts files
An HTTPS listener selects the matching project certificate by SNI. Route registration prepares or refreshes the certificate chain for each hostname.
The proxy daemon does not install the root CA into the trust store. lpm dev uses the normal certificate consent flow.
localhost and *.localhost do not need hosts-file entries. Other local hostnames require a managed entry in the system hosts file.
lpm dev asks for consent before it changes the hosts file. When the dev session exits, it removes the project block.
If an interrupted session leaves an LPM CLI-managed block, remove it with:
lpm hosts cleanThe proxy start and stop actions do not manage hosts-file entries. lpm hosts owns that cleanup.
lpm dev --https uses a separate LPM CLI frontend. It does not configure the local-domain proxy listener.
Status and JSON output
lpm proxy status shows the daemon status, PID, bound listeners, and active routes. lpm proxy list shows only the active routes.
Use JSON for scripts and diagnostics:
lpm proxy status --json
lpm proxy list --json
lpm proxy start --detach --jsonThe JSON object includes these fields:
runningpidhttpAddrhttpRedirectAddrtlsAddrroutesstalestateError
Saved listener addresses can remain in the JSON object while stale is true. In that state, running is false and no routes are active.
Foreground lpm proxy start --json is not supported. Use lpm proxy status --json from another terminal.
Flags
| Flag | Applies to | Effect |
|---|---|---|
--detach | start | Start the daemon in the background and wait for readiness. |
--http-port <PORT> | start, install | Bind a plain HTTP listener on 127.0.0.1:<PORT>. |
--tls-port <PORT> | start, install | Bind an HTTPS listener on 127.0.0.1:<PORT>. |
--http-redirect-port <PORT> | start, install | Bind an HTTP redirect listener. This flag requires --tls-port. |
--privileged-ports | install, uninstall | On Linux and macOS, install or remove the root-owned low-port forwarder. |
--replace | install --privileged-ports | Replace a privileged forwarder that belongs to another UID. |
--json | status, list, stop, install, uninstall, detached start | Write machine-readable output. Foreground start is not supported. This is a global flag. |
Related configuration
| Field | Purpose |
|---|---|
proxy.host | Route the primary or single dev service through one hostname. |
proxy.port | Select the HTTPS listener for commands without listener flags. The default is 443. |
proxy.httpRedirect | Enable the port 80 redirect for commands without listener flags. The default is true. |
services.<name>.host | Route one named service through its own hostname. |
See the full lpm.json reference for hostname validation and service fields.