mac开发vue3项目,vite proxy 失败
mac开发会偶现proxy error,比如,通过代理跨域,浏览器发送10个请求,偶尔有几个请求一直pending,不能够返回数据,查看nginx日志,根本没收到请求,原因大概率在前端,vite server是用的http-proxy,通过看http-proxy发现,有个agent配置https。代码如下import https from 'https'{changeOrigin: true,se
·
mac开发会偶现proxy error,比如,通过代理跨域,浏览器发送10个请求,偶尔有几个请求一直pending,不能够返回数据,查看nginx日志,根本没收到请求,原因大概率在前端,
vite server是用的http-proxy,通过看http-proxy发现,有个agent配置https。
代码如下
import https from 'https'
{
changeOrigin: true,
secure: false,
//mac 代理失败
agent: new https.Agent(),
}
更多推荐
已为社区贡献1条内容
所有评论(0)