webpack-hot-middleware run error under https
Our dev environment had upgraded from HTTP to https, but when I use the config of ?path=http//localhost:XXXX under the entry in webpack.config.js ,
webpack.config.js
'index': [
'webpack-hot-middleware/client?path=http//localhost:' + siteConfig.port + '/__webpack_hmr',
'./js/index'
],
There are some mixed content error thrown :
Mixed Content: The page at 'https://corp.dinghuo123.com/index.html#/order/indent?_k=i76wt3' was loaded over HTTPS, but requested an insecure EventSource endpoint 'http://localhost:9898/__webpack_hmr'. This request has been blocked; the content must be served over HTTPS.
so ,I change the config of HTTP to https like this:
webpack.config.js
'index': [
'webpack-hot-middleware/client?path=https//localhost:' + siteConfig.port + '/__webpack_hmr',
'./js/index'
],
But another error been thrown.
GET https://localhost:9898/__webpack_hmr net::ERR_CONNECTION_CLOSED
Can anyone have some prompt?
I am running into the same problem. I would like to be able to use HTTPS for development but it is giving me the same error.
https://0.0.0.0/__webpack_hmr net::ERR_CONNECTION_REFUSED
@andrewgbliss is the server running on port 443? If not you'll need the port number in there
@glenjamin I have my node process running on 3000 and using nginx for a proxy running on port 80 for http and 443 for https. I have noticed though that if I put:
webpack-hot-middleware/client?noInfo=false&path=http://0.0.0.0:3000/__webpack_hmr
And I go straight to port 3000 it works a lot faster than going through nginx. But I am not sure how to get it working with https
Ooooh, I just realised - 0.0.0.0 is invalid for a request address, it's only a valid value for listening addresses.
Use 127.0.0.1 or the hostname in the client config instead.
@glenjamin It worked. Thank you. I changed it to:
webpack-hot-middleware/client?noInfo=false&path=http://127.0.0.1:3000/__webpack_hmr
And I was able to use https with it. I am not sure about the OP though. You shouldn't have to change it to https right?
You shouldn't have to, but it should work with either.
Hi, I.m also facing the same problem. I want my local to render in browser using https. I have updated my changes as discussed in the above, but still i'm facing the issue.But when i use webpack-dev-server if i add "webpack-dev-server -d --hot --https --port 443" my application is rendering in https.
Can anyone help how to work on webpack-hot-middleware using https.
Hello, same here, does anyone resolved it?