Description
What is the current behavior?
In 0.16.4, webpack-dev-server introduced host checking #887 . Even though localhost
and 127.0.0.1
is by default exempt from host checking, it still brings trouble to local development.
In our team, our local environment host is localhost.xxxx.com
to share cookie with domain xxxx.com
. But, localhost.xxxx.com
is not taken as localhost.
What is the expected behavior?
It would be better to have localhost checking with regex.
Just change
webpack-dev-server/lib/Server.js
Line 412 in 2957853
// always allow localhost host, for convience
if(hostname === "127.0.0.1" || hostname.test(/localhost/)) return true;
I know there is a disableHostCheck
option to web-dev-server. However, we're not directly depending on webpack-dev-server
, but on react-server
which controls options to webpack-dev-server
. So, an improved localhost checking is preferred.
Thanks.