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(),

}

Logo

前往低代码交流专区

更多推荐