Skip to content

misleading tips about address #358

@uiolee

Description

@uiolee

Check List

  • I have already read README.
  • I have already searched existing issues and they are not help to me.
  • I examined error or warning messages and it's difficult to solve.
  • I am using the latest version of this repository.
  • I am using the latest version of Hexo.
  • My Node.js is matched the required version.

Describe the bug

hexo-server/index.js

Lines 8 to 9 in d5ed997

// `undefined` uses Node's default (try `::` with fallback to `0.0.0.0`)
ip: undefined,

Image

In default setting, "hexo-server" will run at [::].
But "hexo-server" output localhost in console.
Such prompts mislead users, and may bring security risks.

if (ip === '0.0.0.0' || ip === '::') {
hostname = 'localhost';
}

Expected behavior

"hexo-server" should output the real listening address in console.

How to reproduce

  1. hexo init
  2. hexo s
  3. visit the localhost address like "[::1]:4000", and found accessible.
  4. visit the LAN address like "192.168.xx.x:4000", and found accessible.
  5. visit the WAN address like "xxx.xxx.xxx.xxx:4000", and found accessible(If you have a public network address and open this port).

Screenshots

No response

Environment information

windows 10
debian 12

node 22

Additional context

Additionally and Personally, I would expected "hexo-server" should listen localhost in default to reduce security risks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions