You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Web socket connections from an Electron BrowserWindow always have a origin header of file://. Connections to the devServer websocket server are always rejected unless you set allowedHosts: "all".
This is because this code always fails, returning a Invalid Host/Origin header error. Digging into the code a bit, it's because this code always resolves hostname as '' for origin: file://, meaning that it's impossible to add anything to allowedHosts that would match in this loop.
I suggest modifying the logic of this method to treat file:// as localhost.
This is a bug
This is a modification request
Code
N/A
Please paste the results of npx webpack-cli info here, and mention other relevant information
Web socket connections from an Electron BrowserWindow always have a
origin
header offile://
. Connections to the devServer websocket server are always rejected unless you setallowedHosts: "all"
.This is because this code always fails, returning a
Invalid Host/Origin header
error. Digging into the code a bit, it's because this code always resolveshostname
as''
fororigin: file://
, meaning that it's impossible to add anything toallowedHosts
that would match in this loop.I suggest modifying the logic of this method to treat
file://
aslocalhost
.Code
N/A
Please paste the results of
npx webpack-cli info
here, and mention other relevant informationExpected Behavior
That I can specify something in
allowedHosts
to be able to accept requests from Electron BrowserWindows whereorigin
header isfile://
.Actual Behavior
This is not possible
For Bugs; How can we reproduce the behavior?
N/A
For Features; What is the motivation and/or use-case for the feature?
To be able to use webpack dev server without having to have the websocket server open to the world.
The text was updated successfully, but these errors were encountered: