Exposing a local development server over a public HTTPS address such as [https://example.instawormhole.site](https://example.instawormhole.site) frequently trips up modern frontend and full-stack tooling. When a visitor opens your .instawormhole.site address, a request passes through InstaWormhole's edge and relay and arrives at your local loopback listener. That local server expects localhost or 127.0.0.1 by default, so receiving an external tunnel hostname—or routing WebSocket traffic through an HTTPS reverse tunnel—can trigger host rejection messages, failed asset loads, broken hydration, or frozen hot module replacement (HMR).
This guide covers how to configure Vite, Next.js, Expo, Shopify CLI, and Laravel so each development server accepts your .instawormhole.site tunnel address and preserves hot reload. For official project settings and setup walkthroughs, see the InstaWormhole Framework Guides and the InstaWormhole Quick Start.
Why HTTPS Tunnels Break Local Dev Servers
Local development servers are designed for local machine loops rather than public internet traffic. When you open a tunnel with @instawormhole/connector—for example using npx @instawormhole/connector run --relay wss://relay.instawormhole.site --origin 127.0.0.1:3000 --stored-device --tunnel or quick port commands such as npx @instawormhole/connector 8081 or npx @instawormhole/connector 8000—traffic enters over https://example.instawormhole.site and is forwarded to your local port.
Three things commonly fail when a framework is not explicitly configured for that tunnel:
-
Host validation checks: Modern dev servers verify incoming hostnames to guard against DNS rebinding and unexpected origins, rejecting unrecognized
.instawormhole.sitehostnames. - Cross-origin dev asset blocks: Frameworks may block scripts, stylesheets, or hot-update requests fetched from an external origin during local development, breaking hot reload and client hydration.
- WebSocket and proxy mismatches: Hot reload relies on WebSockets, and apps behind a proxy need explicit protocol, port, or proxy trust settings so client sockets and generated URLs target the public HTTPS address rather than an internal port.
Before changing framework settings, confirm your local app already responds cleanly on its local address (such as http://localhost:3000) and replace example.instawormhole.site in the examples below with your actual tunnel hostname.
Note: Tunnel traffic is served under
instawormhole.site, separate frominstawormhole.comwhere your account and dashboard live, and the tunnel exposes your local app to visitors allowed by your tunnel's access settings. Always check what your local server exposes before sharing a tunnel.
Quick Reference by Framework
| Framework / Tool | Primary Symptom Over Tunnel | Configuration Target | Key Setting |
|---|---|---|---|
| Vite (v6 and later) |
Blocked request. This host is not allowed. or stalled HMR |
vite.config.js |
server.allowedHosts and server.hmr (wss, port 443) |
| Next.js (v15 and later) | Blocked dev assets, broken hot reload or hydration | next.config.js |
allowedDevOrigins |
| Expo | Device cannot reach or advertise the tunnel packager URL | CLI environment variable |
EXPO_PACKAGER_PROXY_URL with npx expo start
|
| Shopify CLI | CLI starts its own tunnel instead of using yours | CLI flag | --tunnel-url https://example.instawormhole.site:443 |
| Laravel / PHP | Generated links point to local URL or proxy headers are ignored |
.env and bootstrap/app.php
|
APP_URL and $m->trustProxies(at: '*') (Laravel 11+) |
Step-by-Step Framework Setup
1. Vite (Vite 6 and Later)
Vite 6 and later refuse host names they do not recognize and respond with Blocked request. This host is not allowed.. In Vite's server configuration documentation, server.allowedHosts controls which hostnames Vite accepts for incoming requests, helping prevent DNS rebinding attacks when a custom or tunneled hostname hits the dev server.
Even after allowing the host, hot reload over an HTTPS tunnel requires configuring Vite's HMR client so WebSocket connections use secure WebSockets (wss) on port 443. Browsers viewing a page over https:// typically block insecure ws:// connections to local ports or fail to connect when the client tries to open a socket directly against the origin port rather than the public HTTPS port 443 terminated at the edge. Setting protocol: 'wss' and clientPort: 443 in server.hmr aligns the browser's WebSocket client with the external HTTPS endpoint while the tunnel forwards traffic back to your local Vite process.
Update vite.config.js with your tunnel address:
export default {
server: {
allowedHosts: ['example.instawormhole.site'],
hmr: {
protocol: 'wss',
clientPort: 443,
},
},
}
If you use TypeScript or ESM with defineConfig, you can wrap the configuration object with defineConfig from 'vite', keeping the same server.allowedHosts and server.hmr values. Restart the Vite dev server after editing vite.config.js. When configured properly, the page loads through [https://example.instawormhole.site](https://example.instawormhole.site) and edits update in the browser without a manual reload.
2. Next.js (Next.js 15 and Later)
Next.js 15 and later block development assets requested from other origins, which interferes with hot reload and hydration when viewing the app through a .instawormhole.site address. According to Next.js's allowedDevOrigins documentation, configuring allowedDevOrigins specifies allowed origins for requests to /_next/* and other development resources during local development.
When those cross-origin dev asset requests are blocked, the browser can fail to load chunks, CSS, or Fast Refresh updates, leaving hydration incomplete or stalling live updates even when the initial HTML document renders.
Add your tunnel hostname to allowedDevOrigins in next.config.js:
module.exports = {
allowedDevOrigins: ['example.instawormhole.site'],
}
If your project uses next.config.mjs or next.config.ts, export the same allowedDevOrigins property on your nextConfig object. Restart Next.js after saving the change. Your page should load its development scripts cleanly and maintain hot reload over the tunnel.
3. Expo
When testing a mobile app on a device through InstaWormhole, tunnel the Metro bundler port (8081) and set EXPO_PACKAGER_PROXY_URL so Expo advertises your tunnel HTTPS URL instead of relying on expo start --tunnel. Per Expo's environment variables documentation, EXPO_PACKAGER_PROXY_URL sets the URL for the packager server when running behind a proxy or tunnel so manifest and bundle URLs point to the public address reachable by external or mobile clients.
Start your tunnel on port 8081 and run Expo with the proxy URL set:
npx @instawormhole/connector 8081
EXPO_PACKAGER_PROXY_URL=https://example.instawormhole.site npx expo start
Keep in mind that a basic connector run prints a temporary address; if you want the same address across sessions, use a durable tunnel from the dashboard. Once started, Expo advertises your .instawormhole.site address so you can open it on a test device. Make sure your physical device or simulator has network access to [https://example.instawormhole.site](https://example.instawormhole.site) and that port 8081 is not already occupied by another Metro instance.
4. Shopify CLI
By default, Shopify CLI starts its own tunnel when developing apps that require a public URL. As documented in the Shopify CLI shopify app dev reference, passing --tunnel-url tells the CLI to use a custom tunnel URL instead of creating its own tunnel.
To route development traffic through your InstaWormhole tunnel instead, connect your tunnel to your app's port first and pass the tunnel URL to shopify app dev.
shopify app dev --tunnel-url https://example.instawormhole.site:443
Verify that the CLI uses your specified tunnel URL rather than spinning up a separate default tunnel. Ensure the port forwarded by your InstaWormhole tunnel matches the local port your Shopify app server listens on so incoming requests from [https://example.instawormhole.site](https://example.instawormhole.site) reach the app cleanly.
5. Laravel and PHP
When running Laravel locally behind a tunnel, the application needs both a matching APP_URL for generated links and proxy trust configuration so requests arriving through the tunnel are handled properly. According to Laravel's trusted proxies documentation, Laravel does not trust forwarded headers from proxies by default unless configured, which can cause scheme (http vs https), host, or client IP detection to reflect the internal connection rather than the public HTTPS proxy.
Start a tunnel to port 8000 and run Laravel's development server on port 8000:
npx @instawormhole/connector 8000
php artisan serve --port=8000
In your .env file, set APP_URL to your tunnel address:
APP_URL=https://example.instawormhole.site
In Laravel 11 and later, configure trusted proxies in bootstrap/app.php so the application trusts proxy headers from the tunnel path:
<?php
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Middleware;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware): void {
$middleware->trustProxies(at: '*');
})
->create();
If you had a cached configuration file from an earlier run, clear or refresh cached config with php artisan config:clear after updating .env or bootstrap/app.php. After restarting your server, links generated by Laravel point to [https://example.instawormhole.site](https://example.instawormhole.site) and recognize the HTTPS scheme over the proxy.
Troubleshooting Host Rejections and Broken Hot Reload
If a tunnel still misbehaves after updating your framework config, work through these checks in order:
-
Confirm the exact tunnel hostname: Make sure the hostname in
allowedHosts,allowedDevOrigins,EXPO_PACKAGER_PROXY_URL,--tunnel-url, orAPP_URLmatches the active.instawormhole.siteaddress without extra path segments. -
Restart the dev server after config edits: Config files such as
vite.config.jsandnext.config.jsand.envchanges are read on startup; restart the local server whenever you update them. -
Fix host rejection errors (
Blocked request): If the browser displaysBlocked requestor another host-not-allowed message, your framework rejected the incoming hostname. Add the tunnel address to the framework setting above and restart. -
Fix hot reload when the page loads: If HTML loads over HTTPS but updates do not arrive live, check WebSocket connectivity. In Vite, verify
hmr: { protocol: 'wss', clientPort: 443 }; in Next.js, verify the tunnel hostname is listed inallowedDevOrigins. - Inspect traffic and run diagnostics: Use the request inspector in the InstaWormhole dashboard to see whether requests reach your local app and what status code is returned, and consult the InstaWormhole Diagnostic Codes or Tunnel Not Working Guide if a layer below the framework is failing.
Working systematically from local server health to hostname allowlists, proxy/WebSocket settings, and tunnel diagnostics isolates most tunnel issues quickly. Keep your local server listening on the intended loopback port, match every framework configuration value to your active .instawormhole.site host, and re-verify after each restart.
Originally published at https://instawormhole.com/blog/fix-dev-server-host-errors-behind-an-https-tunnel
Top comments (0)