Remote browser tabs should resolve localhost to the remote host or support port forwarding
Problem
When Codex is connected to a remote Mac, the in-app browser tab is opened from the client host. If a service is running on the remote Mac at 127.0.0.1:<port>, navigating the browser tab to http://localhost:<port> resolves localhost on the client host instead of the remote Mac. This makes it difficult to inspect or use development servers and other local-only services on the remote machine.
Reproduction
- Connect Codex Desktop on client Mac A to remote Mac B.
- On Mac B, start a service bound to
127.0.0.1:3000. - Open the Codex in-app browser from the client connection.
- Navigate to
http://localhost:3000.
The browser either reaches a client-host service or fails to connect; it does not reach the service on Mac B.
Expected behavior
When the active Codex context is a remote connection, users should have one of these supported paths:
localhostin the browser tab is proxied to the remote host, sohttp://localhost:3000reaches Mac B; or- Codex provides an explicit port-forwarding control, for example
remote 3000 -> client 3000, with clear lifecycle, port-collision handling, and security confirmation.
The UI should make it clear whether a browser tab is local or remote and which host a forwarded port targets. A per-tab or per-connection mapping would also allow multiple remote sessions without ambiguous localhost behavior.
Related
Related to #26170, which covers SSH LocalForward handling but not browser access to remote localhost services.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗