Skip to content

Commit e338c23

Browse files
committed
relay proxy for dev
1 parent e6f60e6 commit e338c23

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎vite.config.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,24 @@ export default defineConfig({
2525
// `/labs/node`) — relative URLs resolve against the *document*, so a missing slash drops a
2626
// segment. Dev is unaffected: Vite forces base to `/` when serving.
2727
base: "./",
28+
server: {
29+
proxy: {
30+
// The relay endpoint is origin-gated and does not know `localhost`, so anonymous mode
31+
// cannot be exercised under `pnpm dev` at all — it fails before the workspace boots.
32+
// This forwards it under an origin the endpoint does recognize, which is the only thing
33+
// it checks. Dev-only (Vite ignores `server` in a build), and reached by pointing
34+
// `VITE_WISP_URL_ENDPOINT` at `/__wisp/`.
35+
"/__wisp": {
36+
target: "https://sensible-ship-8305.puter.work",
37+
changeOrigin: true,
38+
rewrite: (path: string) => path.replace(/^\/__wisp\/?/, "/"),
39+
headers: {
40+
Origin: "https://developer.puter.com",
41+
Referer: "https://developer.puter.com/labs/node/",
42+
},
43+
},
44+
},
45+
},
2846
build: {
2947
chunkSizeWarningLimit: Infinity,
3048
rolldownOptions: {

0 commit comments

Comments
 (0)