"Invalid Host header": --host 0.0.0.0 not working with public ip, due to webpack-dev-server v2.4.3 security fix
See original GitHub issueHi guys,
I’m still use the 1.0.9
version template, after reinstall my pc and checkout my projects. I ran into an error on my test phone, Invalid Host header
with a white background.
As per https://github.com/webpack/webpack-dev-server/issues/882#issuecomment-296436511, and https://github.com/webpack/webpack-dev-server/releases/tag/v2.4.3,
- Requests are not blocked when
Host
doesn’t match listening host orpublic
option. - Requests to
localhost
or127.0.0.1
are not blocked.
the config in webpack.config.js
(https://github.com/centrual/cordova-template-framework7-vue-webpack/blob/master/template_src/webpack.config.js#L105)
host: "0.0.0.0",
My due date is today, so I just add disableHostCheck: true
under that line to continue the work.
Hope you’ll find a better way to fix this. : )
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
I am getting an "Invalid Host header" message when ...
The problem occurs because webpack-dev-server 2.4.4 adds a host check. You can disable it by adding this to your webpack config:
Read more >Webpack Dev Server External Access - (Fix: Invalid Host ...
No, making host: '0.0.0.0' won't work. No, disableHostCheck won't work. It's depreciated. No, public won' ...
Read more >Webpack-dev-server Invalid host header
The problem occurs because webpack-dev-server 2.4.4 adds a host check. You can disable it by adding this to your webpack config: devServer: {...
Read more >What is this “Invalid Host Header” error? | by Avinash Thakur
This error is most commonly caused by a misconfiguration of the application server that causes it to reject non-local connections. What's going ...
Read more >Using Encore in a Virtual Machine (Symfony Docs)
File Watching Issues; Development Server Issues. Configure the Public Path; Allow External Access; Fix "Invalid Host header" Issue ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m still experiencing this issue. Cordova version 6.5.0, node 6.9.2, clean install of your template. The app con’t connect. After I set
disableHostCheck: true
, the app still doesn’t work, although the app is served atlocalhost:8081
.Am using Angular CLI: 6.2.2 , Node: 8.11.1 and OS: darwin x64 This is my etc hosts 127.0.0.1 dinesh.mysocialapi.com
This is my comment node_modules/@angular/cli/bin/ng serve --host 0.0.0.0 --disableHostCheck true
am getting this error how to fix ? Loading failed for the with source “http://dinesh.mysocialapi.com/vendor.js”. dinesh.mysocialapi.com:34