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

# Live demos & share URLs

> Ship a real HTTPS URL the moment your code listens on a port.

Every VM gets `https://name.boxd.sh` the moment it boots. TLS terminated, HTTP redirects to HTTPS, HSTS set, WebSockets supported. No DNS to point, no certificates to renew, no deploy step. Start a server on port 8000, share the URL.

## How it works

When a VM boots, boxd registers a default proxy that pairs `https://name.boxd.sh` with port 8000 on the VM. DNS is created automatically (60s TTL). You can change the port, swap to auto-detect, or add subdomain proxies for additional services on the same VM.

The result: prototypes, design reviews, and founder demos are one command away from being shareable.

## Use it

```bash theme={"theme":"github-dark"}
boxd machine new demo
ssh demo.boxd 'cd /home/boxd/app && npm run dev'
```

Open `https://demo.boxd.sh` and you're looking at it.

If your app listens on a different port:

```bash theme={"theme":"github-dark"}
boxd machine proxy set-port --vm demo --port 3000
```

Or let boxd pick whichever port your app started on:

```bash theme={"theme":"github-dark"}
boxd machine proxy set-port --vm demo --port auto
```

## Multi-port apps

Frontend on 3000, API on 3001, websocket on 8080? Add a subdomain proxy per port.

```bash theme={"theme":"github-dark"}
boxd machine proxy add api --vm demo --port 3001
boxd machine proxy add ws  --vm demo --port 8080
```

You now have:

```
https://demo.boxd.sh       -> port 3000 (default proxy)
https://api.demo.boxd.sh   -> port 3001
https://ws.demo.boxd.sh    -> port 8080
```

List what you have:

```bash theme={"theme":"github-dark"}
boxd machine proxy list --vm demo --json
```

```json theme={"theme":"github-dark"}
[
  { "name": "default", "vm": "demo", "domain": "demo.boxd.sh",     "port": 3000 },
  { "name": "api",     "vm": "demo", "domain": "api.demo.boxd.sh", "port": 3001 },
  { "name": "ws",      "vm": "demo", "domain": "ws.demo.boxd.sh",  "port": 8080 }
]
```

Remove one with `boxd machine proxy remove api --vm demo`.

## Patterns

### Founder demo

Spin a fresh box, run your dev server, paste the URL into a DM. Suspend it after the call. Resume in microseconds when the next person clicks the link.

```bash theme={"theme":"github-dark"}
boxd machine new acme-demo
# ... start your app ...
# share https://acme-demo.boxd.sh
```

### Design review on a branch

Fork your golden, check out the branch, share the URL with the designer. Destroy the fork when merged.

```bash theme={"theme":"github-dark"}
boxd machine fork yourapp-golden review-nav-redesign
ssh review-nav-redesign.boxd 'cd app && git checkout nav-redesign && pnpm dev'
```

### nginx in front of multiple services

nginx is pre-installed and listens on 8000 once you start it. Point the default proxy at nginx and route internally:

```bash theme={"theme":"github-dark"}
ssh demo.boxd 'sudo systemctl enable --now nginx'
# nginx serves on :8000, proxies to whatever you want internally
```

## FAQ

<AccordionGroup>
  <Accordion title="Do WebSockets work?">
    Yes. The proxy upgrades WebSocket connections transparently.
  </Accordion>

  <Accordion title="Is the URL public?">
    Yes. Anyone with the URL can reach the service. If you need auth, put it in your app or in front of it (e.g. basic auth via nginx).
  </Accordion>

  <Accordion title="What happens to the URL when I destroy the VM?">
    The DNS record is removed. Recreating a VM with the same name reuses the same URL and, when possible, the same SSH port.
  </Accordion>

  <Accordion title="Can I use a custom domain?">
    Custom domain binding isn't available yet. Contact the Azin team if you need it.
  </Accordion>
</AccordionGroup>

## Next

<Columns cols={2}>
  <Card title="Per-PR preview URLs" icon="https://mintcdn.com/azin/Ax1V0serIwQf0x_2/images/icons/branching-paths-up.svg?fit=max&auto=format&n=Ax1V0serIwQf0x_2&q=85&s=06ff61ff2b80a7adc15558368629f9bb" href="/preview-environments/per-pr-preview-urls" width="16" height="16" data-path="images/icons/branching-paths-up.svg">
    A URL per pull request, posted as a comment on the PR.
  </Card>

  <Card title="Proxies" icon="https://mintcdn.com/azin/Ax1V0serIwQf0x_2/images/icons/routing-3.svg?fit=max&auto=format&n=Ax1V0serIwQf0x_2&q=85&s=870ef3744a5e59ab444b8ac8f4ce61bf" href="/how-it-works/proxies" width="16" height="16" data-path="images/icons/routing-3.svg">
    The HTTPS layer in detail. Domains, ports, TLS.
  </Card>
</Columns>
