Skip to content

ng serve --disable-host-check no longer works #9506

@buu700

Description

@buu700

Versions

CLI: 1.6.7
node: 8.9.4
npm: 5.6.0
typescript: 2.6.2
OS: Debian 9.3

Repro steps

  • ng serve --host '0.0.0.0' --port 42002 --public-host 'localhost:42002' --disable-host-check
  • Open http://HostnameOfServer:42002 on a different device

Observed behavior

Request host is not whitelist enabled for this server. Please use the --host command-line flag to whitelist a specific host (recommended) or use --enable_host_checking to disable host checking. See the command-line flags help text for more information.

Desired behavior

Site should load successfully.

Mention any other details that might be useful (optional)

This used to work, but I'm not sure of the version at which it stopped working.

--host '0.0.0.0' is needed while running the CLI in Docker because otherwise it dies with:

getaddrinfo ENOTFOUND '0.0.0.0'
Error: getaddrinfo ENOTFOUND '0.0.0.0'
    at errnoException (dns.js:50:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions