Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misleading tips about address #358

Open
6 tasks done
uiolee opened this issue Feb 11, 2025 · 1 comment · May be fixed by #359 or #53
Open
6 tasks done

misleading tips about address #358

uiolee opened this issue Feb 11, 2025 · 1 comment · May be fixed by #359 or #53

Comments

@uiolee
Copy link
Member

uiolee commented Feb 11, 2025

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.

@uiolee uiolee linked a pull request Feb 11, 2025 that will close this issue
2 tasks
@uiolee
Copy link
Member Author

uiolee commented Feb 12, 2025

#53

I just found out that the same problem has been raised before

@uiolee uiolee linked a pull request Feb 12, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant