Skip to main content
← All guides

Allow a tunnel’s hostname in your dev server

Why qURL here

Keep the app private on your machine and invite the people you choose by email: each verifies their address and saves a passkey, with no account needed, and comes back until you revoke them. Allow the qURL™ hostname once, as the table shows, and it covers everyone you let in. For a quick look, send a one-time qURL link instead.

See how LayerV compares to ngrok →

The setting and value for each dev server

The setting and value for each dev server
Dev serverSettingqURLngrokCloudflare Quick TunnelAlso needed through qURLVersion
Viteserver.allowedHosts in vite.config.js.qurl.siteyour-domain.ngrok-free.app.trycloudflare.comNothing elseVite 8.3.4
Next.jsallowedDevOrigins in next.config.jsYour exact r_….qurl.site browser hostnameyour-domain.ngrok-free.appyour-tunnel.trycloudflare.com (update and restart next dev each run)Your exact r_….qurl.site host in experimental.serverActions.allowedOrigins, in development only, for Server ActionsNext.js 16.4.2
Angular (ng serve)allowedHosts under the serve target’s options in angular.json.qurl.siteyour-domain.ngrok-free.app.trycloudflare.comng serve --host 127.0.0.1, and a restart after editingAngular CLI 22.2.3
Astroserver.allowedHosts in astro.config.mjs (Astro 5.4 and later).qurl.siteyour-domain.ngrok-free.app.trycloudflare.comNothing elseAstro 7.4.0
SvelteKitserver.allowedHosts in vite.config.js.qurl.siteyour-domain.ngrok-free.app.trycloudflare.comShare vite dev: form actions under vite preview need an exact trusted originSvelteKit 3.1.0
Nuxtvite.server.allowedHosts in nuxt.config.ts.qurl.siteyour-domain.ngrok-free.app.trycloudflare.comNothing else; avoid nuxt dev --publicNuxt 4.6.2
webpack-dev-serverdevServer.allowedHosts in webpack.config.js.qurl.siteyour-domain.ngrok-free.app.trycloudflare.comclient.webSocketURL: auto://0.0.0.0:0/ws for hot reload, as through any HTTPS tunnelwebpack-dev-server 6.1.0 and 5.2.7
DjangoALLOWED_HOSTS in settings.py, with localhost kept.qurl.siteyour-domain.ngrok-free.app.trycloudflare.comThe exact browser https origin in CSRF_TRUSTED_ORIGINS, for form posts; no origin wildcardDjango 6.1.2
Railsconfig.hosts in config/environments/development.rb.qurl.siteyour-domain.ngrok-free.app.trycloudflare.comA development-only exact browser-origin exception in ApplicationController, retaining the CSRF token checkRails 8.1.4

Steps

Dev servers reject unknown tunnel hosts. Vite-based servers use allowedHosts; Next.js uses allowedDevOrigins; Django uses ALLOWED_HOSTS; Rails uses config.hosts. For qURL, allow .qurl.site; in Next.js allowedDevOrigins, use the exact browser hostname instead. For ngrok, use your exact dev domain, including ngrok-free.dev if assigned. With qURL, the app stays on your machine with no public URL, and each link opens once.

  1. Recognise the error

    Each dev server words it differently. Vite, and Angular, Astro, SvelteKit and Nuxt on top of it, answer “Blocked request. This host is not allowed”. Next.js logs “Blocked cross-origin request to Next.js dev resource”. webpack-dev-server answers “Invalid Host header”, Django “Invalid HTTP_HOST header” (DisallowedHost), and Rails “Blocked hosts”.

  2. Allow the hostnames your framework requires

    For host checks, a leading dot allows the domain and its subdomains, so the next link or tunnel run works too. Next.js checks browser origins instead: allow the exact browser hostname from the recipient in allowedDevOrigins, never a whole-domain wildcard. qURL and Cloudflare Quick Tunnels use a new subdomain each time; ngrok keeps one dev domain per account, so its exact name is enough. The table’s ngrok-free.app examples stand for your assigned hostname; use ngrok-free.dev if assigned. In Rails a leading dot covers only one more label, so .ts.net does not cover machine.tailnet.ts.net; use the tailnet’s own domain there.

  3. Check form posts and hot reload through qURL

    A qURL link’s browser origin (r_….qurl.site) differs from the host the app receives (c-….qurl.site). Servers that compare the two need one more setting, listed in the table: Next.js for Server Actions, Django and Rails for form posts. webpack-dev-server’s hot reload client needs client.webSocketURL behind any HTTPS tunnel.

  4. Share it through qURL

    Publish the address the dev server listens on. The example uses Vite’s default port 5173; replace it with the port your app prints. Vite-based servers can listen only on the IPv6 address [::1], depending on localhost resolution. If publish cannot connect to 127.0.0.1, publish http://[::1]:PORT in quotes, or start the dev server with --host 127.0.0.1 and publish that address. Your app stays on this computer; nothing listens on your network. Each qurl share link opens once and expires within 24 hours.

    qurl publish http://127.0.0.1:5173
    qurl share <CRID>

What the recipient sees

With the domain allowed, the page loads through the link and hot reload connects.

Troubleshooting

Troubleshooting
If you seeDo this
The setting is in place but the page is still blockedThe server did not reload its config. Vite, Astro, SvelteKit and Nuxt apply config edits on their own; ng serve, webpack-dev-server, Next.js and Rails need a restart.
The page loads, but form posts fail through qURL and not through ngrokThe server compares the browser’s origin with its own host, and under qURL those differ. Add the extra setting from the table’s qURL column.
Show 6 more fixes
More troubleshooting
If you seeDo this
qurl publish says the local app is not accepting TCP connectionsStart the app first and check that curl works on the same address. qurl publish connects to localhost as 127.0.0.1, so if your app listens only on IPv6 (on macOS or Linux, lsof -iTCP -sTCP:LISTEN -nP shows [::1]), publish 'http://[::1]:PORT' instead, or start the dev server with --host 127.0.0.1 and publish that address. Neither requires listening on your LAN. Keep the quotes: zsh treats the brackets as a pattern.
The recipient sees “Access link invalid”The link was already used or has expired. Run qurl share again and send the new link.
The recipient sees “Resource not found”The resource was deleted after the link was made. Publish the app again, then run qurl share and send the new link.
publish rejects http://127.0.0.1 with “only HTTPS URLs are allowed”, asks you to log in, or prints no Access: lineYour qURL CLI is out of date. On macOS run brew update, then brew upgrade qurl; elsewhere install the latest release. After updating, qurl --version prints 3.4.1 or later, and every publish is private by default.
publish says this Linux session “can’t reach a systemd user manager”You are in a container or sandbox without a user service manager. Run qurl publish with --foreground; sharing lasts as long as that process runs. Container and CI setup →
publish says “Quota Exceeded” with “protected resource limit reached”, or “Your qURL account has reached a plan limit”You can see this without an account: a device with no account can keep up to 3 active resources, with links that last up to 24 hours. Run qurl list --status active, then qurl delete <CRID> for any you no longer need (it asks you to confirm; --yes skips that). qurl stop keeps the resource, so it does not free a slot.

Frequently Asked Questions

Why do dev servers block unknown hosts?

To stop DNS rebinding, where a website you visit points its own name at your machine and reads your dev server. Vite added its check in 6.0.9, 5.4.12 and 4.5.6 (advisory GHSA-vg6x-rcgg-rjx6), and Rails added host authorization in 6.0 for the same reason.

Can I just turn the check off?

Every server has a switch: allowedHosts true or all, ALLOWED_HOSTS ["*"], clearing config.hosts, ng serve --allowed-hosts, nuxt dev --public. Each lets any website that rebinds a name reach your dev server. List the domains you use instead.

Which extra setting do form posts need through qURL?

Through qURL the browser is on r_….qurl.site while the app receives c-….qurl.site. Next.js Server Actions and Django and Rails form posts compare the two, so trust that exact browser address in development. The table lists the setting for each; update it when the browser hostname changes.

Who else can reach my app while the link is open?

Opening the link starts a session for that browser, which lasts 1 hour by default. After a browser opens it, another browser on the same public IP cannot use its access. A script or agent that opens the link without a browser is admitted by its network address instead, which other devices on that public IP share until the session ends. A link admits whoever opens it: the API’s IP and country rules do not apply to the signed links qurl share issues. Keep your app’s own sign-in for anything sensitive.

Publish your app now

Install the CLI, then run one command. No sign-up, no API key.

Install the CLI →

Book a pilot

Tell us what to hide. We’ll scope a pilot.

Enterprise starts with a paid pilot on one application, typically 60 to 90 days, credited in full toward year one if you convert within 60 days. After that, an annual package sized to what you protect, not per seat.