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

# Streaming modes

> Stream the desktop over Moonlight (WebRTC) or over VNC, and how to switch between them.

The desktop has two streaming modes.

| Mode | Transport | Quality | Best for |
| - | - | - | - |
| Moonlight (default) | WebRTC, which uses UDP and peer connections | Video and audio, 1920x1080 at 60 fps | Most networks |
| VNC | Plain HTTPS | Lower frame rate | Strict, corporate or low-bandwidth networks |

On a strict, corporate or low-bandwidth network, Moonlight can be choppy. It can also fail to connect. VNC works much better on a poor connection.

## Open the desktop over VNC

<CodeGroup>
  ```bash CLI theme={null}
  boat desktop bx_f7k2q9hd --vnc
  boat desktop bx_f7k2q9hd --vnc --public
  ```

  ```bash curl theme={null}
  curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/desktop?vnc=1" \
    -H "Authorization: Bearer $BOAT_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"publicAccess":true}'
  ```

  ```ts TypeScript theme={null}
  const vnc = await sandbox.desktop({
    sandboxId: "bx_f7k2q9hd",
    vnc: 1,
    requestBody: { publicAccess: true },
  });
  console.log(vnc.desktopUrl);
  ```

  ```python Python theme={null}
  vnc = sandbox.desktop("bx_f7k2q9hd", vnc=1, request_body={"publicAccess": True})
  print(vnc.desktop_url)
  ```
</CodeGroup>

## Switch mode in the viewer

You do not have to choose the mode first.

* The browser viewer shows a **"Switch to VNC"** option while the default stream connects or plays.
* The viewer shows this option again if the default stream has an error.
* The sandbox menu in the dashboard has three items: **Desktop**, **Browser** and **Desktop via VNC**.

<Note>
  The VNC viewer opens as its own top-level page. It is not embedded. Its connection can authenticate only from a top-level page. The first `--vnc` on a sandbox takes a few seconds to prepare. Later opens are instant.
</Note>


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