当前位置:   article > 正文

【Vue】解决Vue项目做内网穿透后访问 Invalid Host header._vue 内外穿透报错host

vue 内外穿透报错host

talk is cheap, show me the code.

devServer.disableHostCheck
boolean
When set to true this option bypasses host checking. THIS IS NOT RECOMMENDED as apps that do not check the host are vulnerable to DNS rebinding attacks.

https://webpack.js.org/configuration/dev-server/#devserverdisablehostcheck

  • vue-cli 2.x
    devServer: {
     disableHostCheck: true,
    }
    
    • 1
    • 2
    • 3
  • vue-cli 3.x
    module.exports = {
      devServer: {
        disableHostCheck: true
      }
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5

参考

vue-cli配置参考
webpack documention

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/188213
推荐阅读
相关标签
  

闽ICP备14008679号