Skip to content

Angular 9 --disableHostCheck flag has no effect when --host is passed (or --configuration) #20951

Closed

Description

Created a new project with Angular CLI 9.1.15 (but also tested with version 11.2.13, no difference at all):

$ npm run start -- --host 0.0.0.0 

> angular-nine-template@0.0.0 start /home/rkrisztian/tmp/angular-nine-template
> ng serve "--host" "0.0.0.0"

WARNING: This is a simple server for use in testing or debugging Angular applications
locally. It hasn't been reviewed for security issues.

Binding this server to an open connection can result in compromising your application or
computer. Using a different host than the one passed to the "--host" flag might result in
websocket connection issues. You might need to use "--disableHostCheck" if that's the
case.
(...)
$ npm run start -- --host 0.0.0.0 --disableHostCheck true 

> angular-nine-template@0.0.0 start /home/rkrisztian/tmp/angular-nine-template
> ng serve "--host" "0.0.0.0" "--disableHostCheck" "true"

WARNING: This is a simple server for use in testing or debugging Angular applications
locally. It hasn't been reviewed for security issues.

Binding this server to an open connection can result in compromising your application or
computer. Using a different host than the one passed to the "--host" flag might result in
websocket connection issues. You might need to use "--disableHostCheck" if that's the
case.
WARNING: Running a server with --disable-host-check is a security risk. See https://medium.com/webpack/webpack-dev-server-middleware-security-issues-1489d950874a for more information.
(...)

Why does it still warn me?

I can't do anything about it, becuase if I move the host parameter to angular.json, and use --configuration to specify the configuration I want to use, the problem is still back, and --disableHostCheck cannot do anything about it!

Please help, this is really frustrating. Although right now we are on Angular version 9, we do plan to upgrade all the way up to 11 (maybe to 12 later), but it takes time...

Activity

  1. added this to the Backlog milestone on May 26, 2021
  2. alan-agius4 commented on May 26, 2021

    @alan-agius4
    Collaborator

    NB: this has no impact on the functionality of the dev-server. The warning is just being shown all the time.

  3. added 2 commits that reference this issue on May 26, 2021
    7ff41e4
    923f56e
  4. angular-automatic-lock-bot commented on Jun 26, 2021

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  5. locked and limited conversation to collaborators on Jun 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions