Skip to content

[FEATURE] Preview should allow localhost subdomains (e.g. playground.localhost) #47195

Description

@zhawtof

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

When using the Preview feature, navigating to a localhost subdomain like playground.localhost:3000 is blocked with the message:

Link to playground.localhost was blocked. Preview only supports localhost URLs.

Localhost subdomains resolve to 127.0.0.1 the same as localhost and are commonly used in local development (e.g. multi-tenant apps that route by subdomain). The preview URL allowlist should permit *.localhost in addition to localhost.

Image

Proposed Solution

The Preview URL allowlist should permit *.localhost in addition to localhost. All subdomains of localhost (e.g. playground.localhost, app.localhost) resolve to 127.0.0.1 per RFC 6761 and are safe to allow. No configuration should be needed — this should just work out of the box.

Alternative Solutions

Currently there's no workaround within Preview. The only option is to open the URL manually in a separate browser, which defeats the purpose of the integrated preview.

Priority

High - Significant impact on productivity

Feature Category

CLI commands and flags

Use Case Example

  1. I'm building a multi-tenant SaaS app (Tightknit) where each community is accessed via a localhost subdomain in local dev (e.g. playground.localhost:3000)
  2. I set up .claude/launch.json and start the dev server via Preview
  3. The app loads at localhost:3000 then redirects to playground.localhost:3000
  4. Preview blocks the redirect with "Link to playground.localhost was blocked"
  5. I have to copy the URL and open it in a separate browser, losing the integrated preview workflow

Additional Context

Localhost subdomains are guaranteed to resolve to loopback by RFC 6761 and are widely used by frameworks like Next.js, Vite, and Rails for multi-tenant local development. Most browsers and dev tools treat them identically to localhost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions