Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renderer 的 server.proxy 配置失效 #631

Open
4 tasks done
tom-style opened this issue Oct 9, 2024 · 2 comments
Open
4 tasks done

renderer 的 server.proxy 配置失效 #631

tom-style opened this issue Oct 9, 2024 · 2 comments

Comments

@tom-style
Copy link

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

@HydrogenBlackhole
Copy link

我也有这样的问题 打包后就不行

@alex8088
Copy link
Owner

请确认是否csp问题,无更多详细信息

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants