question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"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 issue

Hi 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 or public option.
  • Requests to localhost or 127.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:closed
  • Created 6 years ago
  • Comments:6

github_iconTop GitHub Comments

5reactions
tstikvoortcommented, May 15, 2017

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 at localhost:8081.

0reactions
dineshmaths1commented, Sep 17, 2018

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found