alex8088 / electron-vite

Next generation Electron build tooling based on Vite 新一代 Electron 开发构建工具,支持源代码保护
https://electron-vite.org
MIT License
3.56k stars 153 forks source link

renderer 的 server.proxy 配置失效 #631

Open tom-style opened 1 month ago

tom-style commented 1 month ago

Describe the bug

renderer 的 server.proxy 配置,在单独的WEB项目可以,放到vite这里代理失效;

renderer: {
  server: {
    proxy: {
      '/api': {
        target: 'https://www....',
          changeOrigin: true,
          ws: true,
          headers: {
          Referer: 'https://www.....'
        },
        rewrite: [Function: rewrite],
        secure: false
      }
    }
  }
}

Electron-Vite Version

2.3.0

Electron Version

25.9.8

Vite Version

5.3.1

Validations