Skip to main content

Preview URLs

Preview URLs let you access applications running inside a workspace from your browser. When a dev server starts on a port, Aether automatically generates a public URL that proxies traffic to the workspace VM.

URL Format

Preview URLs follow this pattern:
https://{port}-{projectIdPrefix}.preview.runaether.dev
For example, a Vite dev server running on port 5173 in project abc12345:
https://5173-abc12345.preview.runaether.dev

Token-Protected URLs

For additional security, you can include an optional token in the URL:
https://{port}-{projectIdPrefix}-{token}.preview.runaether.dev
Example:
https://3000-abc12345-mysecrettoken.preview.runaether.dev
Requests without a valid token are rejected. This is useful for sharing previews with specific people without exposing them publicly.

How Routing Works

When a request hits a preview URL, the gateway:
  1. Parses the subdomain to extract the port, project ID prefix, and optional token
  2. Looks up the project by its short prefix (cached for 30 seconds)
  3. Validates the auth token if one is included in the URL
  4. Fetches the VM’s private IP from the workspace record
  5. Proxies the request to {vmIp}:{port} inside the workspace

Port Discovery

Aether automatically discovers open ports inside the workspace. When a new port opens or closes, events are emitted to the frontend. You don’t need to configure anything — start a dev server on any port and the preview URL becomes active immediately.
Port discovery runs continuously while the workspace is active. New ports are detected within seconds of a server starting.

WebSocket Support

Preview URLs fully support WebSocket connections. This means:
  • Hot Module Replacement (HMR) works through the proxy — Vite, Next.js, and webpack dev servers update in real-time
  • WebSocket-based applications (chat, real-time dashboards) work without modification
No special configuration is needed. The gateway upgrades connections to WebSocket when the client requests it.

Host Header Rewriting

The gateway rewrites the Host header to localhost:{port} before proxying to the VM. This ensures dev servers that check the host (like Vite’s default config) accept the request without additional configuration.

CORS Headers

The gateway includes CORS headers in responses to allow cross-origin requests. This enables:
  • Embedding previews in iframes
  • Making API calls from a frontend preview to a backend preview on a different port
  • Browser extensions and developer tools accessing preview URLs

Troubleshooting

IssueCauseSolution
502 Bad GatewayDev server not running on the expected portStart the server and verify the port number
TimeoutWorkspace is stopped or startingStart the workspace and wait for running state
Connection refusedPort is open but server is not accepting connectionsCheck server logs with aether task watch or SSH in
HMR not workingWebSocket blocked by network/proxyVerify WebSocket support in your network configuration
Preview URL routing is cached for 30 seconds. If you delete and recreate a project with the same prefix, there may be a brief delay before the new workspace’s IP is resolved.