> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bead.run/llms.txt
> Use this file to discover all available pages before exploring further.

# Sandbox port forwarding

> Set up sandbox port forwarding to open authenticated HTTP and WebSocket applications on localhost.

Start the application inside your machine before setting up sandbox port forwarding. Keep the CLI process running for as long as you need access.

## Open an application

Start your application on an explicit guest port, then run:

```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
bead open ID --port 3000
```

The CLI opens your browser and keeps forwarding until you press Ctrl-C. It supplies bead traffic authentication. Your application's own login still applies.

## Forward without opening a browser

```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
bead port-forward ID --port 3000 --local-port 3000
```

Open the printed localhost URL. Choose another local port if port 3000 is occupied. The listener binds to loopback on your computer.

Keep the CLI process running while you use the application. Ctrl-C closes active forwarding, including WebSocket connections.

## Use from an agent

`bead:sandbox_open` returns the machine application hostname and the local CLI command. Run that command on the computer where you want to open the application. Hosted MCP does not launch a browser on its server.

## Related

Read [application URLs](https://docs.bead.run/connect/public-urls.md) for the hostname's access model, [raw ports](https://docs.bead.run/connect/raw-ports.md) for TCP or UDP services, and [worktree services](https://docs.bead.run/worktrees/services.md) for declared development commands.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.