[英]Webpack log errors "net::ERR_SSL_PROTOCOL_ERROR" by calling sockjs-node/info
on front I use react
on back .net core 3.1
在前面,我在后面使用
react
.net core 3.1
on client I use webpack that is runned on localhost:8080
在客户端上,我使用在
localhost:8080
上运行的 webpack
in Startup.cs I use proxyToSpa在 Startup.cs 我使用 proxyToSpa
applicationBuilder.UseSpa(spa =>
{
spa.UseProxyToSpaDevelopmentServer("http://localhost:8080/");
});
on HTTP works as expected without any errors but on HTTPS I saw a lot of console errors and failed requests in Network there is failed requests for ( sockjs-node/info?t=
...) with error net::ERR_SSL_PROTOCOL_ERROR
在 HTTP 上按预期工作,没有任何错误,但在 HTTPS 上,我看到很多控制台错误和网络中的失败请求,对于 (
sockjs-node/info?t=
...) 的请求失败,错误net::ERR_SSL_PROTOCOL_ERROR
Is there any options to configure webpack or .net core project to avoid these error logs on HTTPS?是否有任何选项可以配置 webpack 或 .net 核心项目以避免 HTTPS 上的这些错误日志?
https://webpack.js.org/configuration/dev-server/#devserverdisablehostcheck https://webpack.js.org/configuration/dev-server/#devserverdisablehostcheck
using cli使用 cli
webpack-dev-server --disable-host-check
or in webpack config或在 webpack 配置中
devServer: {
disableHostCheck: true
}
This might be the issue, it worked for me这可能是问题,它对我有用
https://howchoo.com/chrome/stop-chrome-from-automatically-redirecting-https https://howchoo.com/chrome/stop-chrome-from-automatically-redirecting-https
If you ever visited the https version of a website (whether it resolved or not), Google Chrome might repeatedly send you to that version如果您曾经访问过 https 版本的网站(无论是否已解决),Google Chrome 可能会反复将您发送到该版本
My main site was using https (reverse proxy to development server), so definining public: http://... didn't help for my development server, because the browser forced https (as the main site was https to). My main site was using https (reverse proxy to development server), so definining public: http://... didn't help for my development server, because the browser forced https (as the main site was https to).
What helped me was using https in the devServer too : https://stackoverflow.com/a/29772748/3279070帮助我的是在 devServer 中使用 https : https://stackoverflow.com/a/29772748/3279070
It was important that devServer HTTPS was signed with a good certificate like the main site was (the reverse proxy) and uses a hostname (public property) signed by the cert.重要的是 devServer HTTPS 使用良好的证书签名,就像主站点(反向代理)一样,并使用由证书签名的主机名(公共财产)。 So for example typical scenario is using the same certificate files and the same hostname (public: 'https://hostname:8081') as the main site
因此,例如典型场景是使用相同的证书文件和相同的主机名(公共:'https://hostname:8081')作为主站点
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.