Set Host header for static app tunnel routing

This commit is contained in:
Chris Wanstrath 2026-05-11 16:15:49 -07:00
parent 31ca1d9849
commit c634d488b6

View File

@ -180,6 +180,9 @@ function openTunnel(appName: string, port: number, subdomain?: string, isReconne
onRequest(req) {
const app = getApp(appName)
if (app?.tunnelUrl) req.headers['x-app-url'] = app.tunnelUrl
// Static apps are served by the main server via subdomain routing,
// so set the Host header so extractSubdomain() can identify the app
if (app?.static) req.headers['host'] = `${appName}.localhost`
},
onOpen(assignedSubdomain) {