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

Printing interfaces filters incorrectly on node 18 (in server listening message) #810

Open
alexanderankin opened this issue May 9, 2022 · 2 comments · May be fixed by #811
Open

Printing interfaces filters incorrectly on node 18 (in server listening message) #810

alexanderankin opened this issue May 9, 2022 · 2 comments · May be fixed by #811
Labels

Comments

@alexanderankin
Copy link

This library prints ip addresses to stdout if they are ipv4 after listening. it does this by calling os.networkInterfaces(), which now returns 4 or 6 (unlike before in v17 - family <string> Either IPv4 or IPv6).

Environment Versions

  1. OS Type - any
  2. Node version: $ node --version: v18.0.0
  3. http-server version: $ http-server --version present in latest master -
    if (details.family === 'IPv4') {

Steps to reproduce

  1. install node 18
  2. start server

Expected result

server prints:

Starting up http-server, serving ./
Available on:
  http://127.0.0.1:8082
Hit CTRL-C to stop the server

Actual result

server prints:

Starting up http-server, serving ./
Available on:
Hit CTRL-C to stop the server

Other information

I think the library should take into the current value of process.version when printing listening interfaces. Better yet would be to not check this at all. why not show the user (properly formatted) ipv6 links? I will submit a fix that replicates the old business logic, the new business logic could be considered in a different ticket.

@alexanderankin alexanderankin linked a pull request May 9, 2022 that will close this issue
8 tasks
@alexanderankin alexanderankin changed the title Print interfaces in server listening message correctly on node 18 Printing interfaces filters incorrectly on node 18 (in server listening message) May 9, 2022
@lygstate
Copy link

ping for this

@github-actions
Copy link

This issue has been inactive for 180 days

@github-actions github-actions bot added the stale label Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants