Closed darkexone closed 4 months ago
Open the branch in Web Editor • VS Code • Insiders
Open Preview
A better idea would be to make a mechanism for reading the webSocketURL from the Webpack configuration (as suggested in https://github.com/pmmmwh/react-refresh-webpack-plugin/issues/742 and https://github.com/pmmmwh/react-refresh-webpack-plugin/issues/728), because this fix will help only for part of the problems with connecting to the wrong sockets. Until this mechanism is implemented, we should prefer the plugin configuration over the values read from the path.
With the later versions of WDS v4 and WDS v5 we can actually re-use the "created" server so we no-longer need to parse any of their config. It'll probably come in the next version though.
Thanks for the PR!
Hey, I came across a case where
sockProtocol
is incorrectly overwritten. My application does not use https, but is served through a proxy that uses https. I have https disabled in the webpack configuration, but the protocol read from the window is https. I tried passing thesockProtocol
parameter, but found that wss is used all the time, resulting in itegration with overlay not working. I believe that the config passed by the developer (aresourceQuery
) should take priority over a failsafe configuration.A better idea would be to make a mechanism for reading the
webSocketURL
from the Webpack configuration (as suggested in https://github.com/pmmmwh/react-refresh-webpack-plugin/issues/742 and https://github.com/pmmmwh/react-refresh-webpack-plugin/issues/728), because this fix will help only for part of the problems with connecting to the wrong sockets. Until this mechanism is implemented, we should prefer the plugin configuration over the values read from the path.