proxy

Reverse proxy routing by hostname to worktree ports.

Usage

docktree proxy [flags]

The proxy command starts a local reverse proxy that maps hostname-based requests to the correct ports for running worktree instances. Instead of remembering different ports (e.g. localhost:41005), you can access each worktree using its branch or instance name (e.g. http://feature-a.localhost).

Flags

FlagDescription
--port, -p <port>Proxy listen port (default: 8320 or configured in docktree.yml)
--host <host>Proxy listen host interface (default: 127.0.0.1)

How it works

When you start the proxy, it dynamically reads the ports allocated to your running instances. Any request sent to <instance>.localhost (e.g. http://my-branch.localhost:8320) is routed to the corresponding port allocated for that instance's primary HTTP service.

Examples

Start the proxy on the default port (8320):

docktree proxy

Start the proxy on a custom port:

docktree proxy --port 8080

Listen on all interfaces:

docktree proxy --host 0.0.0.0