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

# Preview URLs

> A session gives an HTTP server it started on the computer a public URL that anyone with the link can open

> [!NOTE]
>
> Not in the open-source code yet (preview URLs on a self-hosted instance). On the hosted service this page describes what runs today. On a self-hosted instance today, the session is offered the `preview` tool and every call fails with `preview URLs need an OpenComputer computer; this gateway does not offer them`.

The session creates the URL with the `preview` tool and posts it in the thread. Ask for it in words: "start the app and give me a preview link".

![Sam asks for a preview link named pricing-demo and computer replies with https://pricing-demo.opencomputer.app](https://mintcdn.com/opensandbox/wc3ROkMcBR7DifaQ/images/slack/preview-url.png?fit=max\&auto=format\&n=wc3ROkMcBR7DifaQ\&q=85\&s=13a2ab920c11fd88224bfaeff2217d88)

## URL

| Deployment | URL |
| - | - |
| Hosted | `https://<name>.opencomputer.app` |
| Self-hosted | A wildcard domain the operator points at the gateway. The session is not offered the preview tools until the domain is set; see Gateway. |

| Property | Value |
| - | - |
| Name | Generated unless you ask for one. A port keeps its existing name. |
| Access | Anyone who has the URL can open it; there is no login. A chosen name can be guessed. |
| Traffic | Plain HTTP on that one port, including streamed responses and WebSocket upgrades. The server must not use TLS. |
| Lifetime | While the server runs; `503` otherwise. The server stops with the session's runner, at [idle exit](https://docs.opencomputer.dev/slack/threads.md#idle-exit). |
| Removal | Ask the session to take the URL down. The `unpreview` tool removes it within seconds. |

## Host name checks

Next.js, Vite and webpack-dev-server dev servers refuse requests under a host name they do not expect, and the preview arrives under its public host name. When the tool detects the refusal, its result names the setting to add; the dev server then needs a restart.

| Server | Setting |
| - | - |
| Next.js | `allowedDevOrigins` |
| Vite | `server.allowedHosts` |
| webpack-dev-server | `allowedHosts` |


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