hexojs / hexojs/hexo-server

misleading tips about address

Open
#358 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
81
Forks
55
PR merge metrics
No merged PRs in 30d

Description

### Check List

- [x] I have already read README.
- [x] I have already searched existing issues and they are not help to me.
- [x] I examined error or warning messages and it's difficult to solve.
- [x] I am using the latest version of this repository.
- [x] I am using the [latest](https://github.com/hexojs/hexo/releases) version of Hexo.
- [x] My Node.js is matched the required version.

### Describe the bug

https://github.com/hexojs/hexo-server/blob/d5ed99761352a023687c4284e5f461724ce35ec1/index.js#L8-L9
![Image](https://github.com/user-attachments/assets/99fd2caa-0244-4690-bb11-7cd7adee3f33)

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

https://github.com/hexojs/hexo-server/blob/d5ed99761352a023687c4284e5f461724ce35ec1/lib/server.js#L74-L76

### 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

```text
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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.