Explorar o código

🔧 chore(vite): update proxy configuration

- enable changeOrigin for /mini proxy
- add new websocket proxy /mini-ws pointing to ws://localhost:10086/ws
- add rewrite rule for /mini-ws proxy to remove prefix
yourname hai 4 meses
pai
achega
3d778534a9
Modificáronse 1 ficheiros con 7 adicións e 2 borrados
  1. 7 2
      vite.config.ts

+ 7 - 2
vite.config.ts

@@ -17,9 +17,14 @@ export default defineConfig({
     proxy: {
       '/mini': {
         target: 'http://localhost:10086',
-        // changeOrigin: true,
+        changeOrigin: true,
+      },
+      '/mini-ws': {
+        target: 'ws://localhost:10086/ws',
+        changeOrigin: true,
+        rewrite: path => path.replace(/^\/mini-ws/, ''),
         ws: true
-      }
+      },
     }
   },
   // 配置 @ 别名