Skip to content

Why is the default value of HOST is prettyHost(localhost) instead of 0.0.0.0? #3747

Closed
@hncg

Description

@hncg

What problem does this feature solve?

vue.config.js

module.exports = {
  devServer: {
      port: 5200,
      host: '0.0.0.0',
    },
}

terminal print:

  App running at:
  - Local:   http://localhost:5200/

Shouldn't it be displayed like this?

  App running at:
  - Local:   http://0.0.0.0:5200/

In docker, 'localhost' means that it cannot expose the service to the host unless '0.0.0.0' is used.
In other words, when host is '0.0.0.0', the terminal print 'localhost' is incorrect. May the terminal print '0.0.0.0' would be better?

What does the proposed API look like?

packages/@vue/cli-service/lib/util/prepareURLs.js
at line 33:

//prettyHost = 'localhost'
prettyHost = host

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugintend to implementThe team has the intention to implement this feature at some point. Contribution is also welcome.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions