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

# Proxies

> Every machine gets an HTTPS proxy with its own domain, and you can add subdomain proxies for more ports.

A proxy is an HTTPS endpoint paired with a domain. It terminates TLS and forwards traffic to a port on your machine, with no certificate setup.

## How it works

Every machine automatically gets a **default proxy** at `<machine>.boxd.sh`. It detects the port your app listens on among 80, 443, 8080, 8000, 3000, 5000 and 5173, and falls back to 8000:

```text
https://myapp.boxd.sh  ->  your machine, the port your app listens on (8000 if none is detected)
```

You can create additional **subdomain proxies**, each with its own domain, pointing to different ports:

```text
https://api.myapp.boxd.sh  ->  your machine, port 3001
https://ws.myapp.boxd.sh   ->  your machine, port 8080
```

A machine in [New York](/guides/regions.md) has the same names under `nyc.boxd.sh`, such as `https://myapp.nyc.boxd.sh` and `https://api.myapp.nyc.boxd.sh`.

DNS records are created automatically when the machine boots. Records have a 60-second TTL.

The [HTTPS](/guides/https.md) page covers the default domain itself: getting your first app reachable on it, WebSockets, and the HTTP to HTTPS redirect.

## View your proxies

From your laptop, list the proxies of all your machines:

```bash
boxd machine proxy list
```

Inside a machine, the same command lists that machine's proxies. Filter by machine:

```bash
boxd machine proxy list --vm myapp
```

Each proxy shows its paired domain:

```json
[
  {
    "name": "default",
    "vm": "myapp",
    "domain": "myapp.boxd.sh",
    "port": 8000
  },
  {
    "name": "api",
    "vm": "myapp",
    "domain": "api.myapp.boxd.sh",
    "port": 3001
  }
]
```

## Create a subdomain proxy

Each subdomain proxy gets its own domain at `<name>.<machine>.boxd.sh`:

```bash
boxd machine proxy add api --vm myapp --port 3001
```

This creates the domain `api.myapp.boxd.sh` and forwards HTTPS traffic to port 3001 on your machine.

Inside a machine, the command is `proxy new`, and it targets the machine you are in:

```bash
boxd machine proxy new api --port 3001
```

## Remove a proxy

```bash
boxd machine proxy remove api --vm myapp
```

This removes the proxy and its associated subdomain. Alias: `proxy rm`.

## Change the default port

```bash
boxd machine proxy set-port --vm myapp --port 3000
```

Inside a machine, leave out `--vm` to target the machine you are in:

```bash
boxd machine proxy set-port --port 3000
```

Pass `--port auto` to go back to detecting the listening port.

## Non-HTTP services

Proxies route HTTPS only. To expose a database, an SSH daemon, a game server, or any other raw protocol, add a raw port forward instead. See [Port forwarding](/guides/port-forwarding.md).

## Custom domains

Bring your own domain instead of `<machine>.boxd.sh`: point it at one machine, or delegate a wildcard to your whole organization. See [Custom domains](/guides/custom-domains.md).
