From 2e5bfdd87989b8adc1ca8d2ef2e92353e9212239 Mon Sep 17 00:00:00 2001 From: elpatron Date: Mon, 29 Sep 2025 20:03:23 +0200 Subject: [PATCH] Fix Tailscale Funnel host blocking issue - Add specific allowedHosts configuration for Tailscale domains - Configure both Vite server and Hono dev server to accept .ts.net hosts - Add global middleware to Hono app for host acceptance - Allow master11.warbler-bearded.ts.net and all .ts.net subdomains --- src/server/index.ts | 6 ++++++ vite.config.ts | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/server/index.ts b/src/server/index.ts index e584283..bf70709 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -5,6 +5,12 @@ import { clientEntry } from "./routes/client-entry"; const app = new Hono(); +// Allow all hosts for Tailscale Funnel +app.use("*", async (c, next) => { + // Accept requests from any host + return next(); +}); + app.route("/rpc", rpcApp); app.get("/*", clientEntry); diff --git a/vite.config.ts b/vite.config.ts index 553d3f4..d866a15 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -16,7 +16,7 @@ export default defineConfig(({ mode }) => { host: "0.0.0.0", port: 5173, // Erlaube Zugriffe von beliebigen Hosts (lokal + Proxy/Funnel) - allowedHosts: "all", + allowedHosts: ["localhost", "127.0.0.1", "master11.warbler-bearded.ts.net", ".ts.net"], cors: true, // Keine explizite HMR/Origin-Konfiguration, Vite-Defaults für localhost funktionieren am stabilsten }, @@ -30,6 +30,8 @@ export default defineConfig(({ mode }) => { // it interferes with image imports. exclude: [/src\/client\/.*/, ...defaultOptions.exclude], entry: "./src/server/index.ts", + // Allow all hosts for Tailscale Funnel + allowedHosts: ["localhost", "127.0.0.1", "master11.warbler-bearded.ts.net", ".ts.net"], }), ], };