Blog · · The Expose team

Skip ngrok's browser warning (ERR_NGROK_6024)

Send ngrok-skip-browser-warning from fetch or axios, fix the CORS preflight it causes, and see where no workaround helps, from OAuth to phones.

ERR_NGROK_6024 is the "You are about to visit…" page that ngrok puts in front of browser traffic on its free plan. To skip it, send an ngrok-skip-browser-warning request header with any value, or send a User-Agent that isn't a browser's. If the request comes from a browser on another origin, your server also has to allow that header in its CORS preflight response.

Both fixes only work for requests your own code makes. A client tapping your link, an OAuth redirect or an iframe on someone else's page can't send a header. In those cases the visitor clicks Visit once per browser, or you remove the page with a paid ngrok plan or a tunnel that doesn't have one.

Which fix fits your situation
#

Your situation What works The catch
Your frontend calls an API behind ngrok Send the ngrok-skip-browser-warning header Your API must allow the header in its CORS preflight
A script, cron job, backend or curl Usually nothing; otherwise a non-browser User-Agent Headless browsers send a browser User-Agent
Stripe, GitHub, Shopify or Paddle webhooks Nothing to do None. They don't come from a browser
You test in your own desktop browser Click Visit once, or a header extension The click lasts 7 days, in that browser only
End-to-end tests in a headless browser Add the header in the test runner's config Only for runners that can set headers
A client opens your link on their phone Nothing you can send They read the warning and tap Visit
OAuth or SSO callbacks Nothing you can send The warning lands in the middle of the login
Your app is embedded in a third-party page Nothing you can send The host page makes the requests, not you
QR codes and fresh test devices Nothing you can send Every new browser sees the page
You want the page gone for every visitor A paid ngrok plan, or a tunnel without one Costs money, or a different tool

What triggers ERR_NGROK_6024
#

ngrok shows the page "in front of all HTML browser traffic on the free tier", in the words of its free plan limits. It tells the visitor the site is served by ngrok and that they "should only visit this website if you trust whoever sent the link to you."

The page has a purpose. ngrok introduced it on June 21, 2022 to stop people from hosting phishing pages on free tunnels. On the free plan, every way around it sits on the visitor's side: the request itself has to opt out, and the person running the tunnel can't do that for them.

Two things follow from that:

  • APIs and programmatic access are not affected, according to ngrok. A request without a browser User-Agent goes straight through.
  • Browser requests are. A fetch from your frontend carries the browser's User-Agent, so it can get the warning page's HTML instead of your JSON. Your code then fails with a parse error on a body that starts with <, which is often the first sign of the problem.

Fix 1: send ngrok-skip-browser-warning from fetch or axios
#

ngrok's docs say to set the header "to any value". Their examples use 1, and true or 69420 work just as well.

With fetch:

const response = await fetch('https://your-name.ngrok-free.app/api/orders', {
  headers: {
    'ngrok-skip-browser-warning': '1',
  },
});

With axios, set it once on an instance so every call sends it:

import axios from 'axios';

const api = axios.create({
  baseURL: 'https://your-name.ngrok-free.app',
  headers: { 'ngrok-skip-browser-warning': '1' },
});

The header only goes on requests your JavaScript makes. The browser makes its own requests for <img>, <script> and <link> tags, iframes, form submissions and redirects, and none of those can carry it. If the page itself is served through ngrok, those requests rely on the cookie from clicking Visit (Fix 3).

The header turns your request into a CORS preflight
#

This is where most people get stuck after adding the header. If your frontend runs on another origin, like http://localhost:5173 or a preview deployment, the request is cross-origin. A cross-origin request may only set a few CORS-safelisted headers, such as Accept and Content-Type. ngrok-skip-browser-warning isn't one of them.

So the browser first sends an OPTIONS preflight through the tunnel to your app, naming the header it wants to send:

OPTIONS /api/orders HTTP/1.1
Origin: http://localhost:5173
Access-Control-Request-Method: GET
Access-Control-Request-Headers: ngrok-skip-browser-warning

Your app has to answer with the header in Access-Control-Allow-Headers:

HTTP/1.1 204 No Content
Access-Control-Allow-Origin: http://localhost:5173
Access-Control-Allow-Methods: GET, POST
Access-Control-Allow-Headers: ngrok-skip-browser-warning, Content-Type, Authorization

If it doesn't, the browser never sends the real request. Chrome reports it as "Request header field ngrok-skip-browser-warning is not allowed by Access-Control-Allow-Headers in preflight response."

If your CORS setup lists the allowed headers, add this one. In Express with the cors package:

app.use(cors({
  origin: 'http://localhost:5173',
  allowedHeaders: ['Content-Type', 'Authorization', 'ngrok-skip-browser-warning'],
}));

In Laravel, in config/cors.php:

'allowed_headers' => ['Content-Type', 'Authorization', 'ngrok-skip-browser-warning'],

Access-Control-Allow-Headers: * covers it too, but not on requests with credentials. For cookies or an Authorization header sent with credentials: 'include', MDN says the server must not use the wildcard, so name the header.

If the frontend and the API are both served from the same ngrok URL, there is no CORS. Once you have clicked Visit, the cookie covers your same-origin fetches too.

Fix 2: a non-browser User-Agent for scripts and servers
#

ngrok's second option is to "set and send a custom/non-standard browser User-Agent request header", for example MyApp/0.0.1. This is for code that runs outside a browser.

You usually don't need to do anything. curl, backend HTTP clients and cron jobs don't send a browser User-Agent unless you tell them to, so they pass. The cases that break are code that copies a browser's headers, or a real browser running headless.

// Node.js: only needed if you send a browser-like User-Agent today
await fetch('https://your-name.ngrok-free.app/api/sync', {
  headers: { 'User-Agent': 'MyApp/0.0.1' },
});

For end-to-end tests, which do run a real browser, add the skip header in the runner instead. In Playwright, in playwright.config.ts:

use: {
  baseURL: 'https://your-name.ngrok-free.app',
  extraHTTPHeaders: { 'ngrok-skip-browser-warning': '1' },
},

Webhooks are not affected. Stripe, GitHub, Shopify and Paddle send webhooks from their servers, not from a browser, which is the programmatic access ngrok says the page doesn't touch. If a webhook fails on an ngrok URL, look somewhere else first: the signature, the URL or your handler.

Fix 3: click Visit once
#

For your own browser, clicking through is the simplest fix. According to ngrok's docs, "a cookie suppresses the interstitial for that domain for 7 days."

What that cookie means in practice:

  • It's per domain, so a new ngrok URL shows the page again. The free plan comes with one dev domain on ngrok-free.app, so you keep the same domain between sessions.
  • It's per browser. Your phone, a second browser and every private window start without it.
  • It expires after 7 days, and then you click again.

Fix 4: a header extension, for your own testing only
#

A browser extension that modifies headers can add ngrok-skip-browser-warning to every request, or change your User-Agent. ngrok's docs point to Requestly, and any extension that edits request headers works.

This helps when you test in your own desktop browser and the 7-day click annoys you. It does nothing for anyone else, so it's no fix for a client, a teammate or a phone.

Fix 5: a paid ngrok plan
#

ngrok's docs say "upgrade to any paid ngrok account" to remove the page for all visitors. On ngrok's pricing page on November 14, 2026, the cheapest paid plan was Hobbyist at $10 a month, or $8 a month billed yearly ($96 a year). The Expose vs ngrok comparison puts both products' plans and prices side by side.

What doesn't work
#

  • Setting the header in your app or its middleware. The header has to come from the client making the request. Adding it to your server's responses changes nothing, because ngrok decides whether to show the warning from the request it receives, not from what your app sends back.
  • Adding it with ngrok's Traffic Policy on the free plan. The add-headers action docs say: "You may not use this action to add the ngrok-skip-browser-warning header to skip the ngrok browser warning on free accounts."

Where none of these help
#

Every workaround above needs the request to come from code you control, or a browser you have already clicked through in. These four cases have neither.

You send a client a link to the work in progress. The first thing they see is a page saying the site "is served for free through ngrok.com" and that they should only continue if they trust whoever sent the link. They can't send a header from a link they tapped, so they read the warning and tap Visit. The next time they open the link on their laptop, they see it again.

It works, but in a demo the first impression is a security warning with your name behind it.

OAuth and SSO callbacks
#

After a login, the provider redirects the user's browser to your callback URL. That redirect is a normal browser navigation, so it carries the browser's User-Agent and no header you set. If that browser hasn't clicked through yet, the warning appears in the middle of the login flow, between the provider and your app.

You might not notice in your own browser, because you clicked Visit days ago. A colleague, a private window or the test account on a fresh device hits the page right after the provider's login. The OAuth callbacks guide shows the setup that avoids this, with a URL that also doesn't change.

Embeds in third-party pages
#

When another product loads your app in an iframe, that product's page makes the requests, and it doesn't add vendor-specific headers. One documented case is issue #53 in Anthropic's claude-ai-mcp repository, opened February 11, 2026. Asset requests from Claude.ai's iframes didn't include the header, so they "receive the interstitial HTML page instead of the expected JS/CSS assets", which broke the widget. Anthropic closed the issue as not planned: "We don't plan to add vendor-specific headers (like ngrok-skip-browser-warning) to iframe requests", and recommended a tunnel without an interstitial page instead.

The same applies to any page you don't control that embeds or calls your local app.

QR codes and fresh test devices
#

Scanning a QR code opens the phone's browser with its normal User-Agent, and there is nowhere to add a header. Every phone and tablet you test on sees the warning on its first visit, and so does every private tab and every cloud device session that starts with an empty browser.

Share without a warning page
#

Expose is a localhost tunnel and ngrok alternative that shows no warning page to visitors on any plan, including the free Hobby plan:

expose share http://localhost:3000

Visitors land on your site. Your frontend sends no extra header, your API doesn't need a CORS change for one, and OAuth redirects, iframes and phones reach your app without a page in between. If you already run Laravel Herd, it comes with Expose.

What the free plan has instead: a random URL on every connection, a time limit per connection, and one server in Germany. A demo link or an OAuth redirect URI should stay the same, and for that Expose Pro at $79 a year per user adds reserved subdomains:

expose share http://localhost:3000 --subdomain=my-app

Phones on the same network
#

To test on a phone next to you, share on your local network and scan the QR code in your terminal:

expose share http://localhost:3000 --lan --qr-code

A LAN share needs no account and no internet connection, because your computer serves the site itself. It uses plain HTTP, though. Browsers only allow features like the camera, the clipboard and service workers on HTTPS pages, so test those through a normal share. Its dashboard at http://127.0.0.1:4040 shows a QR code for the public HTTPS URL.

A gate you control
#

ngrok's warning is a gate you can't configure. Without it, you decide who gets in:

# A username and password
expose share http://localhost:3000 --basicAuth="client:secret"

# An email address from your company or one client
expose share http://localhost:3000 [email protected],[email protected]

Magic authentication asks visitors for their email address and remembers them for 7 days. It doesn't send an email to confirm the address, so use basic authentication when that matters.

When you don't need to switch
#

If only webhooks, scripts and your own browser hit your ngrok URL, the warning barely touches you: the first two never see it, and you click Visit once a week. The header and one CORS line cover a frontend you control. Switch when the people or products on the other end can't send a header.

Questions
#

Does the ngrok warning page affect Stripe or GitHub webhooks?
#

No. Webhook providers deliver from their servers, not from a browser, and ngrok says the page doesn't affect programmatic access to an endpoint.

What value should ngrok-skip-browser-warning have?
#

Any value. ngrok's docs say "set it to any value" and use 1 in their examples. What matters is that the request carries the header.

How long does clicking Visit last?
#

7 days, for that domain in that browser, according to ngrok's free plan docs. Another browser, device or private window shows the page again.

Can I turn the warning off in my server or ngrok config?
#

Not on the free plan. The header has to come from the client, and ngrok's Traffic Policy may not add it for free accounts. Any paid ngrok plan removes the page.

Is ERR_NGROK_6024 a bug in my app?
#

No. It's ngrok's own page, shown in place of your response. Your app is fine; the request just didn't get past the warning.


ngrok's behaviour is described as documented on November 14, 2026: ERR_NGROK_6024, free plan limits, the add-headers action and pricing.