Troubleshooting
Webpack hot reload (HMR) behind a reverse proxy
When using Webpack behind a reverse proxy like LocalCan, you will need to add this code to the webpack.config.js
file in order to use hot reloads (HMR) which work through a WebSocket connection.
webpack.config.js
...
allowedHosts: 'all',
client: {
...
webSocketURL: 'auto://0.0.0.0:0/ws',
},
After adding these, WebSocket connection will be established successfully on both http (ws) and https (wss) connections.
© 2024 LocalCan™. All rights reserved.